diff options
author | John MacFarlane <jgm@berkeley.edu> | 2017-12-22 10:35:53 -0800 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2017-12-22 10:36:37 -0800 |
commit | 9758720a24d7cc9782579bb237d747d32cf72835 (patch) | |
tree | 4032d5768f3cac0c28c17d01c29d7db7830a3b3f | |
parent | 279c254007601de5cb6a44e0d51522748880d732 (diff) | |
download | pandoc-9758720a24d7cc9782579bb237d747d32cf72835.tar.gz |
RST writer: fix anchors for headers.
We were missing an `_`.
See #4188.
-rw-r--r-- | src/Text/Pandoc/Writers/RST.hs | 2 | ||||
-rw-r--r-- | test/command/3937.md | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Writers/RST.hs b/src/Text/Pandoc/Writers/RST.hs index 42d4d0040..515276985 100644 --- a/src/Text/Pandoc/Writers/RST.hs +++ b/src/Text/Pandoc/Writers/RST.hs @@ -250,7 +250,7 @@ blockToRST (Header level (name,classes,_) inlines) = do let headerChar = if level > 5 then ' ' else "=-~^'" !! (level - 1) let border = text $ replicate (offset contents) headerChar let anchor | null name || name == autoId = empty - | otherwise = ".. " <> text name <> ":" $$ blankline + | otherwise = ".. _" <> text name <> ":" $$ blankline return $ nowrap $ anchor $$ contents $$ border $$ blankline else do let rub = "rubric:: " <> contents diff --git a/test/command/3937.md b/test/command/3937.md index 1d5e4238a..2f32cd172 100644 --- a/test/command/3937.md +++ b/test/command/3937.md @@ -3,7 +3,7 @@ # My Great Section {#mysection} # Other section ^D -.. mysection: +.. _mysection: My Great Section ================ |