mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 06:04:11 +08:00
Only allow a recursive depth of 3 for markdown links.
This commit is contained in:
parent
6ebc2dcf5c
commit
64a3afe35a
9
vendor/assets/javascripts/better_markdown.js
vendored
9
vendor/assets/javascripts/better_markdown.js
vendored
|
@ -1250,6 +1250,15 @@
|
|||
|
||||
"[": function link( text ) {
|
||||
|
||||
var open = 1;
|
||||
for (var i=0; i<text.length; i++) {
|
||||
var c = text.charAt(i);
|
||||
if (c === '[') { open++; }
|
||||
if (c === ']') { open--; }
|
||||
|
||||
if (open > 3) { return [1, "["]; }
|
||||
}
|
||||
|
||||
var orig = String(text);
|
||||
// Inline content is possible inside `link text`
|
||||
var res = inline_until_char.call( this, text.substr(1), "]" );
|
||||
|
|
Loading…
Reference in New Issue
Block a user