From 6be0df5576c3cee4e86254d27ef17e79809070c3 Mon Sep 17 00:00:00 2001 From: Pedro Calixto Date: Wed, 21 Oct 2020 19:51:37 -0300 Subject: [PATCH] Fix backtick for code in links Previously, when there as an inline code as a link label, it would only work if the backticks were single-opened and single-closed (as in 1 backtick opening the code block + 1 backtick closing the code block). Now one can use more than 1 backtick to open/close the inline code block as a link label. Closes #1663. --- src/rules.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rules.js b/src/rules.js index 2951ed58fb..47775916ce 100644 --- a/src/rules.js +++ b/src/rules.js @@ -255,7 +255,7 @@ inline.tag = edit(inline.tag) .replace('attribute', inline._attribute) .getRegex(); -inline._label = /(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/; +inline._label = /(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`.*`|[^\[\]\\`])*?/; inline._href = /<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/; inline._title = /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/;