From e666c92bc91a51d49008435dc8555118619037d6 Mon Sep 17 00:00:00 2001 From: Jesse Rosenthal Date: Mon, 17 Oct 2016 09:47:31 -0400 Subject: 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 --- src/Text/Pandoc/Readers/RST.hs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/Text') 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 -- cgit v1.2.3