aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc
diff options
context:
space:
mode:
authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2007-08-29 19:57:01 +0000
committerfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b>2007-08-29 19:57:01 +0000
commit60f700997cb781e925bfec84f4c1ee8739382892 (patch)
treea003b8b5af7ae273d4ec9e8411512545c69835ca /src/Text/Pandoc
parent845a658affdd370c3b8395b1f57754dbb32995dd (diff)
downloadpandoc-60f700997cb781e925bfec84f4c1ee8739382892.tar.gz
+ Fixed bug introduced into referenceTitle by previous changes.
Now it works as before. + Improved Markdown.pl-compatibility in referenceLink: the two parts of a reference-style link may be separated by one space, but not more... [a] [link], [not] [a link]. git-svn-id: https://pandoc.googlecode.com/svn/trunk@955 788f1e2b-df1e-0410-8736-df70ead52e1b
Diffstat (limited to 'src/Text/Pandoc')
-rw-r--r--src/Text/Pandoc/Readers/Markdown.hs11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/Text/Pandoc/Readers/Markdown.hs b/src/Text/Pandoc/Readers/Markdown.hs
index 13345c6a9..877c78ab0 100644
--- a/src/Text/Pandoc/Readers/Markdown.hs
+++ b/src/Text/Pandoc/Readers/Markdown.hs
@@ -168,8 +168,8 @@ referenceKey = try $ do
optional (char '<')
src <- many (noneOf "> \n\t")
optional (char '>')
- tit <- option "" referenceTitle
- blanklines
+ tit <- option "" referenceTitle
+ blanklines
return $ KeyBlock label (removeTrailingSpace src, tit)
referenceTitle = try $ do
@@ -178,7 +178,8 @@ referenceTitle = try $ do
skipSpaces
tit <- (charsInBalanced '(' ')' >>= return . unwords . words)
<|> do delim <- char '\'' <|> char '"'
- manyTill anyChar (try (char delim >> blankline))
+ manyTill anyChar (try (char delim >> skipSpaces >>
+ notFollowedBy (noneOf ")\n")))
return $ decodeCharacterReferences tit
noteMarker = string "[^" >> manyTill (noneOf " \t\n") (char ']')
@@ -825,8 +826,8 @@ link = try $ do
-- a link like [this][ref] or [this][] or [this]
referenceLink label = do
- ref <- option [] (try (skipSpaces >> optional newline >>
- skipSpaces >> reference))
+ ref <- option [] (try (optional (char ' ') >>
+ optional (newline >> skipSpaces) >> reference))
let ref' = if null ref then label else ref
state <- getState
case lookupKeySrc (stateKeys state) ref' of