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

commit60f700997cb781e925bfec84f4c1ee8739382892 authorfiddlosopher <fiddlosopher@788f1e2b-df1e-0410-8736-df70ead52e1b> dateWed 29 Aug 2007, 19:57 (19 years ago) parent845a658
1 file changed+6−5
src/Text/Pandoc/Readers/Markdown.hs+6−5
src/Text/Pandoc/Readers/Markdown.hs+6−5
@@ -168,8 +168,8 @@ referenceKey = try $ do
168168 optional (char '<')
169169 src <- many (noneOf "> \n\t")
170170 optional (char '>')
171− tit <- option "" referenceTitle
172− blanklines
171+ tit <- option "" referenceTitle
172+ blanklines
173173 return $ KeyBlock label (removeTrailingSpace src, tit)
174174
175175referenceTitle = try $ do
@@ -178,7 +178,8 @@ referenceTitle = try $ do
178178 skipSpaces
179179 tit <- (charsInBalanced '(' ')' >>= return . unwords . words)
180180 <|> do delim <- char '\'' <|> char '"'
181− manyTill anyChar (try (char delim >> blankline))
181+ manyTill anyChar (try (char delim >> skipSpaces >>
182+ notFollowedBy (noneOf ")\n")))
182183 return $ decodeCharacterReferences tit
183184
184185noteMarker = string "[^" >> manyTill (noneOf " \t\n") (char ']')
@@ -825,8 +826,8 @@ link = try $ do
825826
826827-- a link like [this][ref] or [this][] or [this]
827828referenceLink label = do
828− ref <- option [] (try (skipSpaces >> optional newline >>
829− skipSpaces >> reference))
829+ ref <- option [] (try (optional (char ' ') >>
830+ optional (newline >> skipSpaces) >> reference))
830831 let ref' = if null ref then label else ref
831832 state <- getState
832833 case lookupKeySrc (stateKeys state) ref' of