mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Cite
synced 2024-11-15 19:10:15 +00:00
Use stricter test for originalDomElementsIndex
Change-Id: I43a0f639fa50fb2bbe9f935dd141d595571d8e24
This commit is contained in:
parent
a42c656c53
commit
4c0e837dad
|
@ -216,7 +216,7 @@ ve.dm.MWReferenceNode.static.toDomElements = function ( dataElement, doc, conver
|
||||||
el.setAttribute( 'data-mw', originalMw );
|
el.setAttribute( 'data-mw', originalMw );
|
||||||
|
|
||||||
// Return the original DOM elements if possible
|
// Return the original DOM elements if possible
|
||||||
if ( dataElement.originalDomElementsIndex ) {
|
if ( dataElement.originalDomElementsIndex !== undefined ) {
|
||||||
return ve.copyDomElements( converter.getStore().value( dataElement.originalDomElementsIndex ), doc );
|
return ve.copyDomElements( converter.getStore().value( dataElement.originalDomElementsIndex ), doc );
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -80,7 +80,7 @@ ve.dm.MWReferencesListNode.static.toDomElements = function ( data, doc, converte
|
||||||
attribs = dataElement.attributes,
|
attribs = dataElement.attributes,
|
||||||
contentsData = data.slice( 1, -1 );
|
contentsData = data.slice( 1, -1 );
|
||||||
|
|
||||||
if ( dataElement.originalDomElementsIndex ) {
|
if ( dataElement.originalDomElementsIndex !== undefined ) {
|
||||||
// If there's more than 1 element, preserve entire array, not just first element
|
// If there's more than 1 element, preserve entire array, not just first element
|
||||||
els = ve.copyDomElements( converter.getStore().value( dataElement.originalDomElementsIndex ), doc );
|
els = ve.copyDomElements( converter.getStore().value( dataElement.originalDomElementsIndex ), doc );
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue