RST writer: fix anchors for headers.

We were missing an `_`.
See #4188.
This commit is contained in:
John MacFarlane 2017-12-22 10:35:53 -08:00
parent 279c254007
commit 9758720a24
2 changed files with 2 additions and 2 deletions

View file

@ -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

View file

@ -3,7 +3,7 @@
# My Great Section {#mysection}
# Other section
^D
.. mysection:
.. _mysection:
My Great Section
================