From bdf04275a2ab44c0d73f1f5d4bd5f0ff42b9a4bd Mon Sep 17 00:00:00 2001 From: Alcaro Date: Tue, 17 Sep 2019 01:56:19 +0200 Subject: [PATCH] inlineCode: fix overzealous replacement $1 only refers to the parens in the first branch of the `` /^ ( *` *) $|^ ( *`)|(` *) $/g `` disjunction. If another branch matches, the replacement will be blank. --- simple-markdown.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/simple-markdown.js b/simple-markdown.js index e6b4cbe..8181b42 100644 --- a/simple-markdown.js +++ b/simple-markdown.js @@ -640,7 +640,7 @@ var LIST_ITEM_R = new RegExp( "gm" ); var BLOCK_END_R = /\n{2,}$/; -var INLINE_CODE_ESCAPE_BACKTICKS_R = /^ ( *` *) $|^ ( *`)|(` *) $/g; +var INLINE_CODE_ESCAPE_BACKTICKS_R = /^ (?= *`)|(` *) $/g; // recognize the end of a paragraph block inside a list item: // two or more newlines at end end of the item var LIST_BLOCK_END_R = BLOCK_END_R;