mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-12-02 11:59:17 -05:00
FIX: Performance issue with [\]
characters.
This commit is contained in:
parent
64a3afe35a
commit
e20d649dee
1 changed files with 5 additions and 3 deletions
8
vendor/assets/javascripts/better_markdown.js
vendored
8
vendor/assets/javascripts/better_markdown.js
vendored
|
@ -655,7 +655,7 @@
|
||||||
|
|
||||||
if ( consumed >= text.length ) {
|
if ( consumed >= text.length ) {
|
||||||
// No closing char found. Abort.
|
// No closing char found. Abort.
|
||||||
return null;
|
return [consumed, null, nodes];
|
||||||
}
|
}
|
||||||
|
|
||||||
var res = this.dialect.inline.__oneElement__.call(this, text.substr( consumed ), patterns );
|
var res = this.dialect.inline.__oneElement__.call(this, text.substr( consumed ), patterns );
|
||||||
|
@ -1264,8 +1264,10 @@
|
||||||
var res = inline_until_char.call( this, text.substr(1), "]" );
|
var res = inline_until_char.call( this, text.substr(1), "]" );
|
||||||
|
|
||||||
// No closing ']' found. Just consume the [
|
// No closing ']' found. Just consume the [
|
||||||
if ( !res )
|
if ( !res[1] ) {
|
||||||
return [ 1, "[" ];
|
var size = res[0] + 1;
|
||||||
|
return [ size, text.charAt(0) + res[2].join('') ];
|
||||||
|
}
|
||||||
|
|
||||||
var consumed = 1 + res[ 0 ],
|
var consumed = 1 + res[ 0 ],
|
||||||
children = res[ 1 ],
|
children = res[ 1 ],
|
||||||
|
|
Loading…
Reference in a new issue