mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-24 22:35:41 +00:00
Use ve.resolveAttributes instead of resolveUrl in clipboard conversion
This method does the tree traversal for us, and resolves src as well as href. Change-Id: Ic3ea47fb9acde9a1dad5caac3ee9c9b63c86d900
This commit is contained in:
parent
e5e1810f02
commit
830718ce22
|
@ -104,11 +104,8 @@ ve.dm.MWExtensionNode.static.toDomElements = function ( dataElement, doc, conver
|
|||
}
|
||||
}
|
||||
if ( converter.isForClipboard() ) {
|
||||
// Resolve image sources
|
||||
$( els ).find( 'img' ).addBack( 'img' ).each( function () {
|
||||
var $this = $( this );
|
||||
$this.attr( 'src', ve.resolveUrl( $this.attr( 'src' ), doc ) );
|
||||
} );
|
||||
// Resolve attributes
|
||||
ve.resolveAttributes( $( els ), doc, ve.dm.Converter.computedAttributes );
|
||||
}
|
||||
return els;
|
||||
};
|
||||
|
|
|
@ -184,11 +184,8 @@ ve.dm.MWTransclusionNode.static.toDomElements = function ( dataElement, doc, con
|
|||
els[ i ].setAttribute( 'data-ve-ignore', 'true' );
|
||||
}
|
||||
|
||||
// Resolve image sources
|
||||
$( els ).find( 'img' ).addBack( 'img' ).each( function () {
|
||||
var $this = $( this );
|
||||
$this.attr( 'src', ve.resolveUrl( $this.attr( 'src' ), doc ) );
|
||||
} );
|
||||
// Resolve attributes
|
||||
ve.resolveAttributes( $( els ), doc, ve.dm.Converter.computedAttributes );
|
||||
}
|
||||
return els;
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue