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:
1 parent
d7f2b5d0f5
commit
3c4e1ff063
1 file changed
+3
-2
@@ -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