| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
ve.ce.MWInlineExtensionNode = function VeCeMWInlineExtensionNode() { |
| 20 |
|
| 21 |
ve.ce.MWInlineExtensionNode.super.apply( this, arguments ); |
| 22 |
}; |
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
OO.inheritClass( ve.ce.MWInlineExtensionNode, ve.ce.MWExtensionNode ); |
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
ve.ce.MWInlineExtensionNode.prototype.onParseSuccess = function ( deferred, response ) { |
| 34 |
const data = response.visualeditor; |
| 35 |
|
| 36 |
let contentNodes = $.parseHTML( data.content ); |
| 37 |
|
| 38 |
if ( contentNodes.length === 1 && contentNodes[ 0 ].nodeName === 'P' ) { |
| 39 |
contentNodes = Array.prototype.slice.apply( contentNodes[ 0 ].childNodes ); |
| 40 |
} |
| 41 |
deferred.resolve( contentNodes ); |
| 42 |
}; |