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

commit73cbae72026ad43d80d0005296adb9f5c8fe858a authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> dateMon 12 Feb 2007, 03:53 (20 years ago) parentca93680
1 file changed+8−6
src/Text/Pandoc/Readers/RST.hs+8−6
src/Text/Pandoc/Readers/RST.hs+8−6
@@ -397,8 +397,8 @@ romanNumeral = do
397397 return result
398398
399399orderedListEnumerator = choice [ many1 digit,
400− string "#",
401− count 1 letter,
400+ count 1 (char '#'),
401+ count 1 letter,
402402 romanNumeral ]
403403
404404-- parses ordered list start and returns its length (inc following whitespace)
@@ -506,7 +506,7 @@ imageKey = try (do
506506 (Src (removeLeadingTrailingSpace src) "")))
507507
508508anonymousKey = try (do
509− choice [string ".. __:", string "__"]
509+ oneOfStrings [".. __:", "__"]
510510 skipSpaces
511511 option ' ' newline
512512 src <- manyTill anyChar newline
@@ -515,7 +515,8 @@ anonymousKey = try (do
515515
516516regularKeyQuoted = try (do
517517 string ".. _`"
518− ref <- manyTill inline (string "`:")
518+ ref <- manyTill inline (char '`')
519+ char ':'
519520 skipSpaces
520521 option ' ' newline
521522 src <- manyTill anyChar newline
@@ -557,7 +558,7 @@ symbol = do
557558-- parses inline code, between codeStart and codeEnd
558559code = try (do
559560 string "``"
560− result <- manyTill anyChar (string "``")
561+ result <- manyTill anyChar (try (string "``"))
561562 let result' = removeLeadingTrailingSpace $ joinWithSep " " $ lines result
562563 return (Code result'))
563564
@@ -624,7 +625,8 @@ anonymousLinkEnding = try (do
624625
625626referenceLink = try (do
626627 char '`'
627− label <- manyTill inline (string "`_")
628+ label <- manyTill inline (char '`')
629+ char '_'
628630 src <- option (Ref []) anonymousLinkEnding
629631 return (Link (normalizeSpaces label) src))
630632