Mholloway has uploaded a new change for review. (
https://gerrit.wikimedia.org/r/397830 )
Change subject: Summary: Strip elements with class 'noprint'
......................................................................
Summary: Strip elements with class 'noprint'
Bug: T182633
Change-Id: Ic2ca9418906b5202082668fab073d0a585c69fbb
---
M lib/transformations/summarize.js
M test/lib/transformations/summarize.js
2 files changed, 6 insertions(+), 0 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/mobileapps
refs/changes/30/397830/1
diff --git a/lib/transformations/summarize.js b/lib/transformations/summarize.js
index d697522..e0becc8 100644
--- a/lib/transformations/summarize.js
+++ b/lib/transformations/summarize.js
@@ -33,6 +33,7 @@
removeAttributes(doc, '*', ['data-mw']);
rmElementsWithSelector(doc, '.mw-ref, .reference');
rmElementsWithSelector(doc, '.noexcerpt');
+ rmElementsWithSelector(doc, '.noprint');
rmElementsWithSelector(doc, 'math');
rmElementsWithSelector(doc, 'span:empty,b:empty,i:empty,p:empty');
diff --git a/test/lib/transformations/summarize.js
b/test/lib/transformations/summarize.js
index 8eba664..6c9f3cf 100644
--- a/test/lib/transformations/summarize.js
+++ b/test/lib/transformations/summarize.js
@@ -23,6 +23,11 @@
'This summary should be nice and clean<span class="noexcerpt">
(elements with class "noexcerpt" will be omitted)</span>.',
'This summary should be nice and clean.'
],
+ // Should strip .noprint
+ [
+ 'This summary should be nice and clean<span class="noprint">
(elements with class "noprint" will be omitted)</span>.',
+ 'This summary should be nice and clean.'
+ ],
// sup elements are retained
[
'<p>A <b>googolplex</b> is the number 10<sup>googol</sup>, or
equivalently, 10<sup>(10<sup>100</sup>)</sup>.</p>',
--
To view, visit https://gerrit.wikimedia.org/r/397830
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic2ca9418906b5202082668fab073d0a585c69fbb
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/mobileapps
Gerrit-Branch: master
Gerrit-Owner: Mholloway <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits