aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Readers
diff options
context:
space:
mode:
authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2007-02-12 03:53:14 +0000
committerfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2007-02-12 03:53:14 +0000
commit73cbae72026ad43d80d0005296adb9f5c8fe858a (patch)
tree20280c460158e3e9030357e032b602a648d234dd /src/Text/Pandoc/Readers
parentca93680f72e8ede39f14147d34e5968ffc8fff60 (diff)
downloadpandoc-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')
-rw-r--r--src/Text/Pandoc/Readers/RST.hs14
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))