mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-29 00:30:44 +00:00
Fix check for preformatted when stripping whitespace
Previous was checking by string match to 'preformatted' which didn't match 'mwPreformatted'. Now using node factory to see if hasSignificantWhitespace is set. Bug: 54083 Change-Id: I1be2d4568df7848e08074d200fb374acd508f6fa
This commit is contained in:
parent
019a6f8e49
commit
e7aed52d93
|
@ -1153,10 +1153,12 @@ ve.dm.Converter.prototype.getDomSubtreeFromData = function ( data, container ) {
|
|||
text = '';
|
||||
isStart = i > 0 &&
|
||||
ve.dm.LinearData.static.isOpenElementData( data[i-1] ) &&
|
||||
ve.dm.LinearData.static.getType( data[i-1] ) !== 'preformatted';
|
||||
!ve.dm.nodeFactory.doesNodeHaveSignificantWhitespace(
|
||||
ve.dm.LinearData.static.getType( data[i-1] )
|
||||
);
|
||||
// Continue forward as far as the plain text goes
|
||||
while ( typeof data[i] === 'string' ) {
|
||||
// HACK: Skip over leading whitespace (bug 51462) in non-pre tags
|
||||
// HACK: Skip over leading whitespace (bug 51462) in non-whitespace-preserving tags
|
||||
if ( !( isStart && data[i].match( /\s/ ) ) ) {
|
||||
text += data[i];
|
||||
isStart = false;
|
||||
|
|
Loading…
Reference in a new issue