jenkins-bot has submitted this change and it was merged.

Change subject: Convert unadapted links to plain text while publishing
......................................................................


Convert unadapted links to plain text while publishing

Ideally, we will require a validator and cleaner from each tool
module before publishing. It is a bit architecture work we have to
do in near future. For now, this is done in a simple way.

Testplan:
Translate LaTeX from en to es. Click on first section, note the
unadapted links in translation. They will be in gray color. Publish.
The published article should not have them as links. They should be
plain text.

Bug: T78133
Change-Id: Ib530fd95c7934f422a6b5850cd06fd861a9987cb
---
M modules/publish/ext.cx.publish.js
M modules/tools/ext.cx.tools.link.js
2 files changed, 6 insertions(+), 0 deletions(-)

Approvals:
  Amire80: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/modules/publish/ext.cx.publish.js 
b/modules/publish/ext.cx.publish.js
index d1bafb9..e8305bd 100644
--- a/modules/publish/ext.cx.publish.js
+++ b/modules/publish/ext.cx.publish.js
@@ -334,6 +334,11 @@
                                return $( this ).html();
                        } );
 
+                       // All unadapted links are unwrapped
+                       $section.find( '.cx-target-link-unadapted' 
).replaceWith( function () {
+                               return $( this ).html();
+                       } );
+
                        // Remove empty sections
                        if ( !$.trim( $section.text() ) ) {
                                $section.remove();
diff --git a/modules/tools/ext.cx.tools.link.js 
b/modules/tools/ext.cx.tools.link.js
index 26e8d30..77f3087 100644
--- a/modules/tools/ext.cx.tools.link.js
+++ b/modules/tools/ext.cx.tools.link.js
@@ -688,6 +688,7 @@
        };
 
        CXTargetLink.prototype.markUnAdapted = function () {
+               // All these unadapted links will be converted to plain text 
while publishing
                this.$link.addClass( 'cx-target-link-unadapted' );
        };
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ib530fd95c7934f422a6b5850cd06fd861a9987cb
Gerrit-PatchSet: 5
Gerrit-Project: mediawiki/extensions/ContentTranslation
Gerrit-Branch: master
Gerrit-Owner: Santhosh <santhosh.thottin...@gmail.com>
Gerrit-Reviewer: Amire80 <amir.ahar...@mail.huji.ac.il>
Gerrit-Reviewer: Nikerabbit <niklas.laxst...@gmail.com>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to