Skip to content

Commit

Permalink
Merge pull request #125 from charleso/bugfix/104-bracket-slow-parse-t…
Browse files Browse the repository at this point in the history
…imeout

Issue #104: Added timeout check in label rule
  • Loading branch information
sirthias committed Feb 26, 2015
2 parents d7a027e + 887dafc commit b200811
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/main/java/org/pegdown/Parser.java
Original file line number Diff line number Diff line change
Expand Up @@ -996,6 +996,7 @@ public Rule AutoLinkEnd() {
public Rule Label() {
return Sequence(
'[',
checkForParsingTimeout(),
push(new SuperNode()),
OneOrMore(TestNot(']'), NonAutoLinkInline(), addAsChild()),
']'
Expand Down
7 changes: 7 additions & 0 deletions src/test/scala/org/pegdown/PathologicalInputSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ class PathologicalInputSpec extends AbstractPegDownSpec {
} mustNotEqual null
}

"properly parse pathological input example 3" in {
new PegDownProcessor(200l).markdownToHtml {
"how about a new method thats getObjectIdOrAdjustmentGroup? That w[a[[[[[[[[[[[[[[[[[y we're more explicit" +
" and still benefit callers from having to do the iff dance"
} must throwA[org.parboiled.errors.ParserRuntimeException]
}

}

}

0 comments on commit b200811

Please sign in to comment.