diff --git a/lib/marked.js b/lib/marked.js index 6f0e87c4c5..3590ae2655 100644 --- a/lib/marked.js +++ b/lib/marked.js @@ -459,7 +459,7 @@ var inline = { text: /^[\s\S]+?(?=[\\?(?:\s+['"]([\s\S]*?)['"])?\s*/; inline.link = replace(inline.link) diff --git a/test/tests/links_inline_style.html b/test/tests/links_inline_style.html index 09df236ed7..04921aa080 100644 --- a/test/tests/links_inline_style.html +++ b/test/tests/links_inline_style.html @@ -13,3 +13,17 @@

URL and title.

Empty.

+ +

Now some links with special link text.

+ +

hello [ ok

+ +

hello [] with balanced brackets

+ +

hello! [ ] with escaped balanced brackets

+ +

hello \ with a backslash

+ +

link w/ escaped back\slash

+ +

link w/ back\slash\

\ No newline at end of file diff --git a/test/tests/links_inline_style.text b/test/tests/links_inline_style.text index 8c8eb4902e..6a94265871 100644 --- a/test/tests/links_inline_style.text +++ b/test/tests/links_inline_style.text @@ -13,3 +13,17 @@ Just a [URL](/url/). [URL and title]( /url/has space/ "url has space and title"). [Empty](). + +Now some links with special link text. + +[hello \[ ok](http://abc.com) + +[hello [] with balanced brackets](http://abc.com) + +[hello! \[ \] with escaped balanced brackets](http://abc.com) + +[hello \ with a backslash](http://abc.com) + +[link w/ escaped back\\slash](http://abc.com) + +[link w/ back\\slash\\](http://abc.com) \ No newline at end of file