mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 09:26:54 -06:00
Workaround markdown-js links parser bug
This commit is contained in:
parent
76824cda31
commit
b8f5c21df0
@ -138,6 +138,10 @@ test("Links", function() {
|
||||
cooked("[http://google.com ... wat](http://discourse.org)",
|
||||
"<p><a href=\"http://discourse.org\">http://google.com ... wat</a></p>",
|
||||
"it supports linkins within links");
|
||||
|
||||
cooked("[Link](http://www.example.com) (with an outer \"description\")",
|
||||
"<p><a href=\"http://www.example.com\">Link</a> (with an outer \"description\")</p>",
|
||||
"it doesn't consume closing parens as part of the url")
|
||||
});
|
||||
|
||||
test("simple quotes", function() {
|
||||
|
2
vendor/assets/javascripts/better_markdown.js
vendored
2
vendor/assets/javascripts/better_markdown.js
vendored
@ -1310,7 +1310,7 @@
|
||||
// back based on if there a matching ones in the url
|
||||
// ([here](/url/(test))
|
||||
// The parens have to be balanced
|
||||
var m = text.match( /^\s*\([ \t]*([^"']*)(?:[ \t]+(["'])(.*?)\2)?[ \t]*\)/ );
|
||||
var m = text.match( /^\s*\([ \t]*([^"'\s]*)(?:[ \t]+(["'])(.*?)\2)?[ \t]*\)/ );
|
||||
if ( m ) {
|
||||
var url = m[1].replace(/\s+$/, '');
|
||||
consumed += m[0].length;
|
||||
|
Loading…
Reference in New Issue
Block a user