mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-09-27 04:06:51 +00:00
Merge "Fix a crasher in unbalanced heading tokenization"
This commit is contained in:
commit
4dcd88fc5f
|
@ -534,6 +534,7 @@ h = & "=" // guard, to make sure '='+ will match.
|
|||
var level = Math.min(s.length, e.length);
|
||||
// convert surplus equals into text
|
||||
if(s.length > level) {
|
||||
s = s.join('');
|
||||
var extras = s.substr(0, s.length - level);
|
||||
if(c[0].constructor === String) {
|
||||
c[0] = extras + c[0];
|
||||
|
@ -542,6 +543,7 @@ h = & "=" // guard, to make sure '='+ will match.
|
|||
}
|
||||
}
|
||||
if(e.length > level) {
|
||||
e = e.join('');
|
||||
var extras = e.substr(0, e.length - level),
|
||||
lastElem = c[c.length - 1];
|
||||
if(lastElem.constructor === String) {
|
||||
|
|
Loading…
Reference in a new issue