aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <fiddlosopher@gmail.com>2012-04-12 09:52:28 -0700
committerJohn MacFarlane <fiddlosopher@gmail.com>2012-04-12 09:52:28 -0700
commitd28ad2b0f13d39863f3aff101e348a380f79f5d1 (patch)
tree80e115ab9a5d0c1163c4e71e1824813059fed09d
parentdbbc932f24ae3d180062c4db9b24fff12e4ae3c9 (diff)
downloadpandoc-d28ad2b0f13d39863f3aff101e348a380f79f5d1.tar.gz
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.
-rw-r--r--src/Text/Pandoc/Readers/Markdown.hs1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/Text/Pandoc/Readers/Markdown.hs b/src/Text/Pandoc/Readers/Markdown.hs
index 666265935..749963cd0 100644
--- a/src/Text/Pandoc/Readers/Markdown.hs
+++ b/src/Text/Pandoc/Readers/Markdown.hs
@@ -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