diff options
author | fiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> | 2007-02-12 03:53:14 +0000 |
---|---|---|
committer | fiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> | 2007-02-12 03:53:14 +0000 |
commit | 73cbae72026ad43d80d0005296adb9f5c8fe858a (patch) | |
tree | 20280c460158e3e9030357e032b602a648d234dd /src/Text/Pandoc/Readers/RST.hs | |
parent | ca93680f72e8ede39f14147d34e5968ffc8fff60 (diff) | |
download | pandoc-73cbae72026ad43d80d0005296adb9f5c8fe858a.tar.gz |
Added 'try' in front of 'string', where needed, or
used a different parser, in RST reader. This fixes
a bug where ````` would not be correctly parsed as
a verbatim `.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@526 788f1e2b-df1e-0410-8736-df70ead52e1b
Diffstat (limited to 'src/Text/Pandoc/Readers/RST.hs')
-rw-r--r-- | src/Text/Pandoc/Readers/RST.hs | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/Text/Pandoc/Readers/RST.hs b/src/Text/Pandoc/Readers/RST.hs index 9a25fe84a..a0bcc822f 100644 --- a/src/Text/Pandoc/Readers/RST.hs +++ b/src/Text/Pandoc/Readers/RST.hs @@ -397,8 +397,8 @@ romanNumeral = do return result orderedListEnumerator = choice [ many1 digit, - string "#", - count 1 letter, + count 1 (char '#'), + count 1 letter, romanNumeral ] -- parses ordered list start and returns its length (inc following whitespace) @@ -506,7 +506,7 @@ imageKey = try (do (Src (removeLeadingTrailingSpace src) ""))) anonymousKey = try (do - choice [string ".. __:", string "__"] + oneOfStrings [".. __:", "__"] skipSpaces option ' ' newline src <- manyTill anyChar newline @@ -515,7 +515,8 @@ anonymousKey = try (do regularKeyQuoted = try (do string ".. _`" - ref <- manyTill inline (string "`:") + ref <- manyTill inline (char '`') + char ':' skipSpaces option ' ' newline src <- manyTill anyChar newline @@ -557,7 +558,7 @@ symbol = do -- parses inline code, between codeStart and codeEnd code = try (do string "``" - result <- manyTill anyChar (string "``") + result <- manyTill anyChar (try (string "``")) let result' = removeLeadingTrailingSpace $ joinWithSep " " $ lines result return (Code result')) @@ -624,7 +625,8 @@ anonymousLinkEnding = try (do referenceLink = try (do char '`' - label <- manyTill inline (string "`_") + label <- manyTill inline (char '`') + char '_' src <- option (Ref []) anonymousLinkEnding return (Link (normalizeSpaces label) src)) |