Arlolra has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/371074 )
Change subject: Use figure-inline instead of span for inline media ...................................................................... Use figure-inline instead of span for inline media Bug: T118520 Depends-On: I5105af1cbb541c8c722417e86220ac82341c556a Change-Id: Id8ec5b77207f43fc7c379b35859dc09f264e2c04 --- M modules/ve-mw/dm/nodes/ve.dm.MWInlineImageNode.js 1 file changed, 11 insertions(+), 11 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/VisualEditor refs/changes/74/371074/1 diff --git a/modules/ve-mw/dm/nodes/ve.dm.MWInlineImageNode.js b/modules/ve-mw/dm/nodes/ve.dm.MWInlineImageNode.js index 0187c7a..e6f7450 100644 --- a/modules/ve-mw/dm/nodes/ve.dm.MWInlineImageNode.js +++ b/modules/ve-mw/dm/nodes/ve.dm.MWInlineImageNode.js @@ -43,17 +43,17 @@ return attributes.indexOf( attribute ) === -1; }; -ve.dm.MWInlineImageNode.static.matchTagNames = [ 'span' ]; +ve.dm.MWInlineImageNode.static.matchTagNames = [ 'span', 'figure-inline' ]; ve.dm.MWInlineImageNode.static.blacklistedAnnotationTypes = [ 'link' ]; ve.dm.MWInlineImageNode.static.toDataElement = function ( domElements, converter ) { var dataElement, attributes, types, - $span = $( domElements[ 0 ] ), - $firstChild = $span.children().first(), // could be <span> or <a> + $figureInline = $( domElements[ 0 ] ), + $firstChild = $figureInline.children().first(), // could be <span> or <a> $img = $firstChild.children().first(), - typeofAttrs = $span.attr( 'typeof' ).split( ' ' ), - classes = $span.attr( 'class' ), + typeofAttrs = $figureInline.attr( 'typeof' ).split( ' ' ), + classes = $figureInline.attr( 'class' ), recognizedClasses = [], errorIndex = typeofAttrs.indexOf( 'mw:Error' ), width = $img.attr( 'width' ), @@ -147,7 +147,7 @@ ve.dm.MWInlineImageNode.static.toDomElements = function ( data, doc ) { var firstChild, mediaClass = data.attributes.mediaClass, - span = doc.createElement( 'span' ), + figureInline = doc.createElement( 'figure-inline' ), img = doc.createElement( mediaClass === 'Image' ? 'img' : 'video' ), classes = [], originalClasses = data.attributes.originalClasses; @@ -156,7 +156,7 @@ img.setAttribute( mediaClass === 'Image' ? 'src' : 'poster', data.attributes.src ); // RDFa type - span.setAttribute( 'typeof', this.getRdfa( mediaClass, data.attributes.type ) ); + figureInline.setAttribute( 'typeof', this.getRdfa( mediaClass, data.attributes.type ) ); if ( data.attributes.defaultSize ) { classes.push( 'mw-default-size' ); @@ -178,9 +178,9 @@ originalClasses && ve.compare( originalClasses.trim().split( /\s+/ ).sort(), classes.sort() ) ) { - span.className = originalClasses; + figureInline.className = originalClasses; } else if ( classes.length > 0 ) { - span.className = classes.join( ' ' ); + figureInline.className = classes.join( ' ' ); } if ( data.attributes.isLinked ) { @@ -190,10 +190,10 @@ firstChild = doc.createElement( 'span' ); } - span.appendChild( firstChild ); + figureInline.appendChild( firstChild ); firstChild.appendChild( img ); - return [ span ]; + return [ figureInline ]; }; /* Registration */ -- To view, visit https://gerrit.wikimedia.org/r/371074 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id8ec5b77207f43fc7c379b35859dc09f264e2c04 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/VisualEditor Gerrit-Branch: master Gerrit-Owner: Arlolra <abrea...@wikimedia.org> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits