From 3c1ef743a036915e2fab180af44edfd45a8053ad Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sun, 31 Jan 2021 22:03:55 -0800 Subject: [PATCH] Fix link label normalization with backslash before newline. Close #211. --- .eslintrc | 2 +- lib/inlines.js | 2 +- test/regression.txt | 13 +++++++++++++ 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/.eslintrc b/.eslintrc index 7845cd43..94517992 100644 --- a/.eslintrc +++ b/.eslintrc @@ -5,7 +5,7 @@ }, "parserOptions": { "sourceType": "module", - "ecmaVersion": 2015 + "ecmaVersion": 2018 }, "rules": { "no-unused-vars": [ diff --git a/lib/inlines.js b/lib/inlines.js index d2526cef..21a0d685 100644 --- a/lib/inlines.js +++ b/lib/inlines.js @@ -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; diff --git a/test/regression.txt b/test/regression.txt index aeaf5973..f3ef5d4b 100644 --- a/test/regression.txt +++ b/test/regression.txt @@ -175,3 +175,16 @@ a a

```````````````````````````````` + +Issue #211 + +```````````````````````````````` example +[\ +foo]: /uri + +[\ +foo] +. +


+foo

+````````````````````````````````