Skip to content

Commit

Permalink
Heading: Fix exponential backtracking
Browse files Browse the repository at this point in the history
Test plan:

1. `make test`
    * Verify all tests now pass
  • Loading branch information
ariabuckles committed Aug 31, 2019
1 parent f7cda49 commit f3332cd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions simple-markdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -836,11 +836,11 @@ var defaultRules /* : DefaultRules */ = {
},
heading: {
order: currOrder++,
match: blockRegex(/^ *(#{1,6}) *([^\n]+?) *#* *(?:\n *)+\n/),
match: blockRegex(/^ *(#{1,6})([^\n]+?)#* *(?:\n *)+\n/),
parse: function(capture, parse, state) {
return {
level: capture[1].length,
content: parseInline(parse, capture[2], state)
content: parseInline(parse, capture[2].trim(), state)
};
},
react: function(node, output, state) {
Expand Down

0 comments on commit f3332cd

Please sign in to comment.