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.
This commit is contained in:
John MacFarlane 2012-04-12 09:52:28 -07:00
parent dbbc932f24
commit d28ad2b0f1

View file

@ -183,6 +183,7 @@ parseMarkdown = do
st <- getState
let firstPassParser = referenceKey
<|> (if stateStrict st then pzero else noteBlock)
<|> liftM snd (withRaw codeBlockDelimited)
<|> lineClump
docMinusKeys <- liftM concat $ manyTill firstPassParser eof
setInput docMinusKeys