aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2012-09-22 13:59:30 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2012-09-22 14:05:09 -0700
commit22bd34fa338edc5fb38cce5adfa11ffbc451b0d4 (patch)
tree3598a3c76d5d788336a13021e6ef5ddf7d6b8950 /tests
parent1038606036a800b8edfd54f96cb8841bf7998872 (diff)
downloadpandoc-22bd34fa338edc5fb38cce5adfa11ffbc451b0d4.tar.gz
Markdown reader: Fixed link parser to avoid exponential slowdowns.
Previously the parser would hang on input like this: [[[[[[[[[[[[[[[[[[hi We fixed this by making the link parser parser characters between balanced brackets (skipping brackets in inline code spans), then parsing the result as an inline list. One change is that [hi *there]* bud](/url) is now no longer parsed as a link. But in this respect pandoc behaved differently from most other implementations anyway, so that seems okay. All current tests pass. Added test for this case. Closes #620.
Diffstat (limited to 'tests')
-rw-r--r--tests/Tests/Readers/Markdown.hs2
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/Tests/Readers/Markdown.hs b/tests/Tests/Readers/Markdown.hs
index 9a79f12f4..1eb2ce31e 100644
--- a/tests/Tests/Readers/Markdown.hs
+++ b/tests/Tests/Readers/Markdown.hs
@@ -48,6 +48,8 @@ tests = [ testGroup "inline code"
[ "in URL" =:
"\\begin\n" =?> para (text "\\begin")
]
+ , "unbalanced brackets" =:
+ "[[[[[[[[[[[[[[[hi" =?> para (text "[[[[[[[[[[[[[[[hi")
, testGroup "backslash escapes"
[ "in URL" =:
"[hi](/there\\))"