Markdown: don't recognize references inside delimited code blocks.
Previously pandoc would produce incorrect results on this:
~~~
[not a link]: /url
~~~
[not a link]
because it would recognize "not a link" as a reference link
definition on the first pass. This fix causes the first pass
to skip delimited code blocks.
commitd28ad2b0f13d39863f3aff101e348a380f79f5d1
authorJohn MacFarlane <fiddlosopher@gmail.com>
dateThu 12 Apr 2012, 09:52 (15 years ago)
parentdbbc932
src/Text/Pandoc/Readers/Markdown.hs+1
@@ -183,6 +183,7 @@ parseMarkdown = do
183183 st <- getState
184184 let firstPassParser = referenceKey
185185 <|> (if stateStrict st then pzero else noteBlock)
186+ <|> liftM snd (withRaw codeBlockDelimited)
186187 <|> lineClump
187188 docMinusKeys <- liftM concat $ manyTill firstPassParser eof
188189 setInput docMinusKeys