Inez has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/69509


Change subject: Always emit figcaption inside figure (even if caption is empty) 
and don't put mw-figcaption class on it (there is no value added in it)
......................................................................

Always emit figcaption inside figure (even if caption is empty) and don't put 
mw-figcaption class on it (there is no value added in it)

Change-Id: I1310d45b5c81cd62b53057717a5211d15119eebe
---
M js/lib/ext.core.LinkHandler.js
1 file changed, 6 insertions(+), 9 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Parsoid 
refs/changes/09/69509/1

diff --git a/js/lib/ext.core.LinkHandler.js b/js/lib/ext.core.LinkHandler.js
index 38f0893..23a753c 100644
--- a/js/lib/ext.core.LinkHandler.js
+++ b/js/lib/ext.core.LinkHandler.js
@@ -680,7 +680,6 @@
                var     dims, image, info, containerName, container, 
containerClose,
                        dataAttribs,
                        rdfaType = 'mw:Image',
-                       captionClass = [ 'mw-figcaption' ],
                        iContainerName = hasImageLink ? 'a' : 'span',
                        ns = data.imgns,
                        innerContain = new TagTk( iContainerName, [] ),
@@ -840,14 +839,12 @@
                        container.addAttribute( 'data-mw', JSON.stringify( {
                                caption: captionSrc
                        } ) );
-               } else if ( caption !== undefined ) {
-                       tokens = tokens.concat( [
-                               new TagTk( 'figcaption', [
-                                       new KV( 'class', captionClass.join( ' ' 
) )
-                               ] ),
-                               caption,
-                               new EndTagTk( 'figcaption' )
-                       ] );
+               } else {
+                       tokens.push( new TagTk( 'figcaption' ) );
+                       if ( caption !== undefined ) {
+                               tokens.push( caption );
+                       }
+                       tokens.push( new EndTagTk( 'figcaption' ) );
                }
 
                tokens.push( containerClose );

-- 
To view, visit https://gerrit.wikimedia.org/r/69509
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1310d45b5c81cd62b53057717a5211d15119eebe
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Parsoid
Gerrit-Branch: master
Gerrit-Owner: Inez <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to