handle escaped brackets in link description
This commit is contained in:
parent
18deb8b071
commit
1949dfdf21
@ -459,7 +459,7 @@ var inline = {
|
||||
text: /^[\s\S]+?(?=[\\<!\[_*`]| {2,}\n|$)/
|
||||
};
|
||||
|
||||
inline._inside = /(?:\[[^\]]*\]|[^\[\]]|\](?=[^\[]*\]))*/;
|
||||
inline._inside = /(?:\[[^\]]*\]|\\[\[\]]|[^\[\]]|\](?=[^\[]*\]))*/;
|
||||
inline._href = /\s*<?([\s\S]*?)>?(?:\s+['"]([\s\S]*?)['"])?\s*/;
|
||||
|
||||
inline.link = replace(inline.link)
|
||||
|
@ -13,3 +13,17 @@
|
||||
<p><a href="/url/has space/" title="url has space and title">URL and title</a>.</p>
|
||||
|
||||
<p><a href="">Empty</a>.</p>
|
||||
|
||||
<p>Now some links with special link text.</p>
|
||||
|
||||
<p><a href="http://abc.com">hello [ ok</a></p>
|
||||
|
||||
<p><a href="http://abc.com">hello [] with balanced brackets</a></p>
|
||||
|
||||
<p><a href="http://abc.com">hello! [ ] with escaped balanced brackets</a></p>
|
||||
|
||||
<p><a href="http://abc.com">hello \ with a backslash</a></p>
|
||||
|
||||
<p><a href="http://abc.com">link w/ escaped back\slash</a></p>
|
||||
|
||||
<p><a href="http://abc.com">link w/ back\slash\</a></p>
|
@ -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)
|
Loading…
x
Reference in New Issue
Block a user