mirror of
https://github.com/showdownjs/showdown.git
synced 2024-03-22 13:30:55 +08:00
Fixed #26 -- Urls which contained matched parenthesis are now supported
This commit is contained in:
parent
2d80b3af04
commit
e6526026ec
|
@ -483,7 +483,7 @@ var _DoAnchors = function(text) {
|
|||
)
|
||||
/g,writeAnchorTag);
|
||||
*/
|
||||
text = text.replace(/(\[((?:\[[^\]]*\]|[^\[\]])*)\]\([ \t]*()<?(.*?)>?[ \t]*((['"])(.*?)\6[ \t]*)?\))/g,writeAnchorTag);
|
||||
text = text.replace(/(\[((?:\[[^\]]*\]|[^\[\]])*)\]\([ \t]*()<?(.*?(?:\(.*?\).*?)?)>?[ \t]*((['"])(.*?)\6[ \t]*)?\))/g,writeAnchorTag);
|
||||
|
||||
//
|
||||
// Last, handle reference-style shortcuts: [link text]
|
||||
|
|
2
test/cases/url-with-parenthesis.html
Normal file
2
test/cases/url-with-parenthesis.html
Normal file
|
@ -0,0 +1,2 @@
|
|||
|
||||
<p>There's an <a href="http://en.memory-alpha.org/wiki/Darmok_(episode)">episode</a> of Star Trek: The Next Generation</p>
|
2
test/cases/url-with-parenthesis.md
Normal file
2
test/cases/url-with-parenthesis.md
Normal file
|
@ -0,0 +1,2 @@
|
|||
|
||||
There's an [episode](http://en.memory-alpha.org/wiki/Darmok_(episode)) of Star Trek: The Next Generation
|
Loading…
Reference in New Issue
Block a user