git.iko.soy/typeable/pandoc
on master help sign in
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.

commit3c4e1ff063100cbdf27f911fcbedbb842adf2af4 authorJohn MacFarlane <fiddlosopher@gmail.com> dateSat 24 Mar 2012, 16:11 (15 years ago) parentd7f2b5d
1 file changed+3−2
src/Text/Pandoc/Readers/RST.hs+3−2
src/Text/Pandoc/Readers/RST.hs+3−2
@@ -807,9 +807,10 @@ strong = enclosed (string "**") (try $ string "**") inline >>=
807807
808808interpreted :: [Char] -> GenParser Char st [Char]
809809interpreted role = try $ do
810− optional $ try $ string "\\ "
810+ -- Note, this doesn't precisely implement the complex rule in
811+ -- http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#inline-markup-recognition-rules
812+ -- but it should be good enough for most purposes
811813 result <- enclosed (string $ ":" ++ role ++ ":`") (char '`') anyChar
812− try (string "\\ ") <|> lookAhead (count 1 $ oneOf " \t\n") <|> (eof >> return "")
813814 return result
814815
815816superscript :: GenParser Char ParserState Inline