diff options
author | Jesse Rosenthal <jrosenthal@jhu.edu> | 2016-10-17 09:47:31 -0400 |
---|---|---|
committer | Jesse Rosenthal <jrosenthal@jhu.edu> | 2016-10-17 09:54:59 -0400 |
commit | e666c92bc91a51d49008435dc8555118619037d6 (patch) | |
tree | 1858764e8facb03db2fec5371fdc120a146fce17 | |
parent | f8603e6df5093fb98ccd6fe038686c096b248509 (diff) | |
download | pandoc-e666c92bc91a51d49008435dc8555118619037d6.tar.gz |
RST reader: skip whitespace before note.
RST requires a space before a footnote marker. We discard those spaces
so that footnotes will be adjacent to the text that comes before
it. This is in line with what rst2latex does. rst2html does not discard
the space, but its html output is different than pandoc's, so this seems
the most semantically correct approach.
Closes #3163
-rw-r--r-- | src/Text/Pandoc/Readers/RST.hs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/Text/Pandoc/Readers/RST.hs b/src/Text/Pandoc/Readers/RST.hs index 64e564278..1b06c6f23 100644 --- a/src/Text/Pandoc/Readers/RST.hs +++ b/src/Text/Pandoc/Readers/RST.hs @@ -949,7 +949,8 @@ table = gridTable False <|> simpleTable False <|> -- inline :: RSTParser Inlines -inline = choice [ whitespace +inline = choice [ note -- can start with whitespace, so try before ws + , whitespace , link , str , endline @@ -958,7 +959,6 @@ inline = choice [ whitespace , code , subst , interpretedRole - , note , smart , hyphens , escapedChar @@ -1174,6 +1174,7 @@ subst = try $ do note :: RSTParser Inlines note = try $ do + optional whitespace ref <- noteMarker char '_' state <- getState |