diff options
author | John MacFarlane <fiddlosopher@gmail.com> | 2012-03-24 16:11:56 -0700 |
---|---|---|
committer | John MacFarlane <fiddlosopher@gmail.com> | 2012-03-24 16:11:56 -0700 |
commit | 3c4e1ff063100cbdf27f911fcbedbb842adf2af4 (patch) | |
tree | 534ac7abb81a3114080e6a0dab0398feb8cffa98 | |
parent | d7f2b5d0f5e076be78bfad06f36447effee33358 (diff) | |
download | pandoc-3c4e1ff063100cbdf27f911fcbedbb842adf2af4.tar.gz |
RST reader: allow :math:`...` even when not followed by blank or \.
This does not implement the complex rule described at
http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#inline-markup-recognition-rules,
but it should be good enough for most purposes.
Closes #453.
-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 759d9802e..30d9aae44 100644 --- a/src/Text/Pandoc/Readers/RST.hs +++ b/src/Text/Pandoc/Readers/RST.hs @@ -807,9 +807,10 @@ strong = enclosed (string "**") (try $ string "**") inline >>= interpreted :: [Char] -> GenParser Char st [Char] interpreted role = try $ do - optional $ try $ string "\\ " + -- Note, this doesn't precisely implement the complex rule in + -- http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#inline-markup-recognition-rules + -- but it should be good enough for most purposes result <- enclosed (string $ ":" ++ role ++ ":`") (char '`') anyChar - try (string "\\ ") <|> lookAhead (count 1 $ oneOf " \t\n") <|> (eof >> return "") return result superscript :: GenParser Char ParserState Inline |