mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-09-26 19:56:49 +00:00
Merge "Remove <section> unwrapping code from ve.ce.MWTransclusionNode"
This commit is contained in:
commit
884d0137a0
|
@ -89,20 +89,15 @@ ve.ce.MWTransclusionNode.static.getDescription = function ( model ) {
|
||||||
* @return {HTMLElement[]} Filtered rendered nodes
|
* @return {HTMLElement[]} Filtered rendered nodes
|
||||||
*/
|
*/
|
||||||
ve.ce.MWTransclusionNode.static.filterRendering = function ( contentNodes ) {
|
ve.ce.MWTransclusionNode.static.filterRendering = function ( contentNodes ) {
|
||||||
var whitespaceRegex, wrapper;
|
var whitespaceRegex;
|
||||||
|
|
||||||
if ( !contentNodes.length ) {
|
if ( !contentNodes.length ) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
whitespaceRegex = new RegExp( '^[' + ve.dm.Converter.static.whitespaceList + ']+$' );
|
whitespaceRegex = new RegExp( '^[' + ve.dm.Converter.static.whitespaceList + ']+$' );
|
||||||
wrapper = contentNodes[ 0 ].ownerDocument.createElement( 'div' );
|
|
||||||
|
|
||||||
// Unwrap Parsoid sections (which probably shouldn't exist: T181226)
|
contentNodes.forEach( ve.stripParsoidFallbackIds );
|
||||||
contentNodes.forEach( function ( node ) { wrapper.appendChild( node ); } );
|
|
||||||
ve.unwrapParsoidSections( wrapper );
|
|
||||||
ve.stripParsoidFallbackIds( wrapper );
|
|
||||||
contentNodes = Array.prototype.slice.call( wrapper.childNodes );
|
|
||||||
|
|
||||||
// Filter out auto-generated items, e.g. reference lists
|
// Filter out auto-generated items, e.g. reference lists
|
||||||
contentNodes = contentNodes.filter( function ( node ) {
|
contentNodes = contentNodes.filter( function ( node ) {
|
||||||
|
|
Loading…
Reference in a new issue