Skip to content

Commit

Permalink
Fixed regexp backtracking problem in footnote definitions and codeblocks
Browse files Browse the repository at this point in the history
Fixes #256
  • Loading branch information
gettalong committed Jul 1, 2015
1 parent c37e128 commit 2574208
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/kramdown/parser/kramdown/blank_line.rb
Expand Up @@ -11,7 +11,7 @@ module Kramdown
module Parser
class Kramdown

BLANK_LINE = /(?:^\s*\n)+/
BLANK_LINE = /(?>^\s*\n)+/

# Parse the blank line at the current postition.
def parse_blank_line
Expand Down
14 changes: 14 additions & 0 deletions test/testcases/span/04_footnote/regexp_problem.html
@@ -0,0 +1,14 @@
<h1>Something</h1>
<p>something<sup id="fnref:note1"><a href="#fn:note1" class="footnote">1</a></sup>.</p>

<h1>Footnotes</h1>

<h1>Test</h1>
<div class="footnotes">
<ol>
<li id="fn:note1">

<p>A note <a href="#fnref:note1" class="reversefootnote">&#8617;</a></p>
</li>
</ol>
</div>
52 changes: 52 additions & 0 deletions test/testcases/span/04_footnote/regexp_problem.text
@@ -0,0 +1,52 @@
# Something
something[^note1].

# Footnotes
[^note1]:
A note













































# Test

0 comments on commit 2574208

Please sign in to comment.