Santhosh has uploaded a new change for review.

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

Change subject: Wrong replaceWith causes all spans getting removed
......................................................................

Wrong replaceWith causes all spans getting removed

Regression from Ia3b59646403dd7c92aedd68002011c135ed57578

replaceWith function not returning anything while the internal condition fails
causes the spans getting removed unconditionally.

Change-Id: I5e7a5079310b944e430c590a6fa7f68b026dd73a
---
M modules/publish/ext.cx.publish.js
1 file changed, 2 insertions(+), 4 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/ContentTranslation 
refs/changes/07/229107/1

diff --git a/modules/publish/ext.cx.publish.js 
b/modules/publish/ext.cx.publish.js
index 3362c6e..0703cf0 100644
--- a/modules/publish/ext.cx.publish.js
+++ b/modules/publish/ext.cx.publish.js
@@ -367,10 +367,8 @@
                        // Browsers add spans with inline styles during free 
editing the content.
                        // For example, Chrome adds <span> on enter key press 
and copies current css styles to inline
                        // styles.
-                       $section.find( 'span' ).replaceWith( function () {
-                               if ( !!$( this ).attr( 'style' ) ) {
-                                       return $( this ).html();
-                               }
+                       $section.find( 'span[style]' ).replaceWith( function () 
{
+                               return $( this ).html();
                        } );
 
                        // Remove empty sections

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5e7a5079310b944e430c590a6fa7f68b026dd73a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/ContentTranslation
Gerrit-Branch: master
Gerrit-Owner: Santhosh <santhosh.thottin...@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to