mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-27 17:46:05 -05:00
FIX: Don't autolink within a markdown link.
This commit is contained in:
parent
cc47ade2ed
commit
b8e63719f8
2 changed files with 10 additions and 0 deletions
|
@ -10,6 +10,10 @@ var urlReplacerArgs = {
|
||||||
var url = matches[1],
|
var url = matches[1],
|
||||||
displayUrl = url;
|
displayUrl = url;
|
||||||
|
|
||||||
|
|
||||||
|
// Don't autolink a markdown link to something
|
||||||
|
if (url.match(/\]\[\d$/)) { return; }
|
||||||
|
|
||||||
// If we improperly caught a markdown link abort
|
// If we improperly caught a markdown link abort
|
||||||
if (url.match(/\(http/)) { return; }
|
if (url.match(/\(http/)) { return; }
|
||||||
|
|
||||||
|
|
|
@ -261,6 +261,12 @@ test("Oneboxing", function() {
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test("links with full urls", function() {
|
||||||
|
cooked("[http://eviltrout.com][1] is a url\n\n[1]: http://eviltrout.com",
|
||||||
|
"<p><a href=\"http://eviltrout.com\">http://eviltrout.com</a> is a url</p>",
|
||||||
|
"it supports links that are full URLs");
|
||||||
|
});
|
||||||
|
|
||||||
test("Code Blocks", function() {
|
test("Code Blocks", function() {
|
||||||
|
|
||||||
cooked("```\na\nb\nc\n\nd\n```",
|
cooked("```\na\nb\nc\n\nd\n```",
|
||||||
|
|
Loading…
Reference in a new issue