Skip to content

Commit

Permalink
Fix link label normalization with backslash before newline.
Browse files Browse the repository at this point in the history
Close #211.
  • Loading branch information
jgm committed Feb 1, 2021
1 parent 1e4ebca commit 3c1ef74
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
},
"parserOptions": {
"sourceType": "module",
"ecmaVersion": 2015
"ecmaVersion": 2018
},
"rules": {
"no-unused-vars": [
Expand Down
2 changes: 1 addition & 1 deletion lib/inlines.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ var reInitialSpace = /^ */;

var reSpaceAtEndOfLine = /^ *(?:\n|$)/;

var reLinkLabel = /^\[(?:[^\\\[\]]|\\.){0,1000}\]/;
var reLinkLabel = /^\[(?:[^\\\[\]]|\\.){0,1000}\]/s;

// Matches a string of non-special characters.
var reMain = /^[^\n`\[\]\\!<&*_'"]+/m;
Expand Down
13 changes: 13 additions & 0 deletions test/regression.txt
Original file line number Diff line number Diff line change
Expand Up @@ -175,3 +175,16 @@ a <?
<p>a <?
?></p>
````````````````````````````````

Issue #211

```````````````````````````````` example
[\
foo]: /uri

[\
foo]
.
<p><a href="/uri"><br />
foo</a></p>
````````````````````````````````

0 comments on commit 3c1ef74

Please sign in to comment.