aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc
diff options
context:
space:
mode:
authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2007-07-28 19:14:50 +0000
committerfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2007-07-28 19:14:50 +0000
commit44b136740b7ab988b96ee67fb67d7395ef3823ce (patch)
tree3f761f1235388a08b5ac6dc70b4d51dde573bf04 /src/Text/Pandoc
parent5e13f8c320dc001609d50048f68785f0b8b99103 (diff)
downloadpandoc-44b136740b7ab988b96ee67fb67d7395ef3823ce.tar.gz
Changes to Markdown reader:
+ added try to def of indentSpaces + in def of 'reference', check to make sure it's not a note reference first. git-svn-id: https://pandoc.googlecode.com/svn/trunk@827 788f1e2b-df1e-0410-8736-df70ead52e1b
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r--src/Text/Pandoc/Readers/Markdown.hs13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/Text/Pandoc/Readers/Markdown.hs b/src/Text/Pandoc/Readers/Markdown.hs
index 3f4c76be4..0ecb09178 100644
--- a/src/Text/Pandoc/Readers/Markdown.hs
+++ b/src/Text/Pandoc/Readers/Markdown.hs
@@ -73,7 +73,7 @@ specialChars = "\\[]*_~`<>$!^-.&'\""
-- | Skip a single endline if there is one.
skipEndline = option Space endline
-indentSpaces = do
+indentSpaces = try $ do
state <- getState
let tabStop = stateTabStop state
try (count tabStop (char ' ')) <|>
@@ -194,7 +194,7 @@ rawLine = try $ do
contents <- many1 nonEndline
end <- option "" (do
newline
- option "" (try indentSpaces)
+ option "" indentSpaces
return "\n")
return (contents ++ end)
@@ -206,8 +206,8 @@ noteBlock = try $ do
failIfStrict
ref <- noteMarker
char ':'
- option ' ' (try blankline)
- option "" (try indentSpaces)
+ option ' ' blankline
+ option "" indentSpaces
raw <- sepBy rawLines (try (do {blankline; indentSpaces}))
option "" blanklines
-- parse the extracted text, which may contain various block elements:
@@ -408,7 +408,7 @@ listContinuation start = try (do
listContinuationLine start = try (do
notFollowedBy' blankline
notFollowedBy' start
- option "" (try indentSpaces)
+ option "" indentSpaces
result <- manyTill anyChar newline
return (result ++ "\n"))
@@ -915,7 +915,8 @@ endline = try (do
--
-- a reference label for a link
-reference = inlinesInBalanced "[" "]" >>= (return . normalizeSpaces)
+reference = notFollowedBy' (string "[^") >> -- footnote reference
+ inlinesInBalanced "[" "]" >>= (return . normalizeSpaces)
-- source for a link, with optional title
source = try $ do