git.iko.soy/typeable/pandoc
on master help sign in
+ Fixed bug introduced into referenceTitle by previous changes.
60f7009fiddlosopher
src/Text/Pandoc/Readers/Markdown.hs+6−5
@@ -168,8 +168,8 @@ referenceKey = try $ do
168 optional (char '<')
168 optional (char '<')
169 src <- many (noneOf "> \n\t")
169 src <- many (noneOf "> \n\t")
170 optional (char '>')
170 optional (char '>')
171− tit <- option "" referenceTitle
171+ tit <- option "" referenceTitle
172− blanklines
172+ blanklines
173 return $ KeyBlock label (removeTrailingSpace src, tit)
173 return $ KeyBlock label (removeTrailingSpace src, tit)
174
174
175referenceTitle = try $ do
175referenceTitle = try $ do
@@ -178,7 +178,8 @@ referenceTitle = try $ do
178 skipSpaces
178 skipSpaces
179 tit <- (charsInBalanced '(' ')' >>= return . unwords . words)
179 tit <- (charsInBalanced '(' ')' >>= return . unwords . words)
180 <|> do delim <- char '\'' <|> char '"'
180 <|> do delim <- char '\'' <|> char '"'
181− manyTill anyChar (try (char delim >> blankline))
181+ manyTill anyChar (try (char delim >> skipSpaces >>
182+ notFollowedBy (noneOf ")\n")))
182 return $ decodeCharacterReferences tit
183 return $ decodeCharacterReferences tit
183
184
184noteMarker = string "[^" >> manyTill (noneOf " \t\n") (char ']')
185noteMarker = string "[^" >> manyTill (noneOf " \t\n") (char ']')
@@ -825,8 +826,8 @@ link = try $ do
825
826
826-- a link like [this][ref] or [this][] or [this]
827-- a link like [this][ref] or [this][] or [this]
827referenceLink label = do
828referenceLink label = do
828− ref <- option [] (try (skipSpaces >> optional newline >>
829+ ref <- option [] (try (optional (char ' ') >>
829− skipSpaces >> reference))
830+ optional (newline >> skipSpaces) >> reference))
830 let ref' = if null ref then label else ref
831 let ref' = if null ref then label else ref
831 state <- getState
832 state <- getState
832 case lookupKeySrc (stateKeys state) ref' of
833 case lookupKeySrc (stateKeys state) ref' of