Skip to content

Commit

Permalink
fix: toc: use our plainify; resolves #521
Browse files Browse the repository at this point in the history
  • Loading branch information
srid committed Mar 6, 2024
1 parent f0e0fdf commit 922f794
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/guide/folgezettel.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Here is the [[target-note]]#
```

{#folder}
## Folder notes
## [[folder-note|Folder notes]]

By default, Emanote includes any directories in your note's path as vertices in the folgezettel graph. This makes the [[folder-note|folder note]] a folgezettel parent of the child note. The contents of a folder, likewise, become folgezetten children of the [[folder-note|folder note]]. For eg., in `foo/bar/qux.md`, "foo" is a folgezettel parent of "bar", and "bar" is a folgezettel parent of "qux".

Expand Down
2 changes: 1 addition & 1 deletion emanote/emanote.cabal
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
cabal-version: 2.4
name: emanote
version: 1.3.14.2
version: 1.3.14.3
license: AGPL-3.0-only
copyright: 2022 Sridhar Ratnakumar
maintainer: [email protected]
Expand Down
4 changes: 2 additions & 2 deletions emanote/src/Emanote/Model/Toc.hs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
module Emanote.Model.Toc where

import Commonmark.Extensions.WikiLink qualified as WL
import Data.Map.Syntax ((##))
import Data.Tree (Tree (Node))
import Data.Tree qualified as Tree
Expand All @@ -9,7 +10,6 @@ import Heist.Extra.Splices.Pandoc (RenderCtx (rootNode))
import Heist.Interpreted qualified as HI
import Relude
import Text.Pandoc
import Text.Pandoc.Shared (stringify)
import Text.XmlHtml qualified as X

type Toc = Tree.Forest DocHeading
Expand All @@ -25,7 +25,7 @@ pandocToHeadings :: Pandoc -> [(Int, DocHeading)]
pandocToHeadings (Pandoc _ blocks) = mapMaybe toHeading blocks
where
toHeading block = case block of
Header hlvl (oid, _, _) inlines -> Just (hlvl, DocHeading oid (stringify inlines))
Header hlvl (oid, _, _) inlines -> Just (hlvl, DocHeading oid (WL.plainify inlines))
_ -> Nothing

-- | Create the Toc
Expand Down

0 comments on commit 922f794

Please sign in to comment.