mirror of
https://github.com/jgm/pandoc.git
synced 2026-09-04 14:45:50 +00:00
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.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user