mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-15 02:23:58 +00:00
Further tweaks to headings. 157 tests now passing.
This commit is contained in:
parent
228fccd0c1
commit
2b5cc67bf5
|
@ -622,7 +622,7 @@ h = & "=" // guard, to make sure '='+ will match.
|
|||
& { return setFlag('h'); }
|
||||
c:inlineline
|
||||
e:'='+
|
||||
spc:(space / comment)*
|
||||
spc:(sp:space+ { return {type: 'TEXT', value: sp.join('') } } / comment)*
|
||||
&eolf
|
||||
{
|
||||
clearFlag('h');
|
||||
|
@ -637,7 +637,7 @@ h = & "=" // guard, to make sure '='+ will match.
|
|||
}
|
||||
}
|
||||
if(e.length > level) {
|
||||
var extras = e.substr(0, s.length - level),
|
||||
var extras = e.substr(0, e.length - level),
|
||||
lastElem = c[c.length - 1];
|
||||
if(lastElem.type == 'TEXT') {
|
||||
lastElem.value = lastElem.value + extras;
|
||||
|
@ -647,7 +647,7 @@ h = & "=" // guard, to make sure '='+ will match.
|
|||
}
|
||||
|
||||
return [{type: 'TAG', name: 'h' + level}]
|
||||
.concat(c, [{type: 'ENDTAG', name: 'h' + level}]);
|
||||
.concat(c, [{type: 'ENDTAG', name: 'h' + level}, spc]);
|
||||
}
|
||||
/ & { dp('nomatch exit h'); clearFlag('h'); return false } { return null }
|
||||
) { return r }
|
||||
|
|
Loading…
Reference in a new issue