diff --git a/lib/marked.js b/lib/marked.js index 105c012653..e57078437f 100644 --- a/lib/marked.js +++ b/lib/marked.js @@ -524,7 +524,7 @@ inline.tag = edit(inline.tag) .replace('attribute', inline._attribute) .getRegex(); -inline._inside = /(?:\[[^\]]*\]|\\[\[\]]|[^\[\]]|\](?=[^\[]*\]))*/; +inline._inside = /(?:\[[^\]]*\]|\\[\[\]]?|`[^`]*`|[^\[\]\\])*?/; inline._href = /\s*(<(?:\\[<>]?|[^\s<>\\])*>|(?:\\[()]?|\([^\s()\\]*\)|[^\s()\\])*?)/; inline._title = /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/; diff --git a/test/new/nested_square_link.html b/test/new/nested_square_link.html index c8b7940831..7b6986a103 100644 --- a/test/new/nested_square_link.html +++ b/test/new/nested_square_link.html @@ -1 +1,3 @@
+ + diff --git a/test/new/nested_square_link.md b/test/new/nested_square_link.md index 82226ed5f6..0f311e9516 100644 --- a/test/new/nested_square_link.md +++ b/test/new/nested_square_link.md @@ -1 +1,3 @@ [the `]` character](/url) + +[the ` character](/url)