Jdlrobson has uploaded a new change for review.

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

Change subject: Remove hatnote from lead section content
......................................................................

Remove hatnote from lead section content

Please use `lead.hatnote` to obtain this information going forward

Change-Id: If1dc94ec7b67e1904e6ea0e4ae025c9b612c2b9e
---
M routes/mobile-sections.js
M test/features/mobile-sections-lead/pagecontent.js
2 files changed, 5 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/services/mobileapps 
refs/changes/65/309165/1

diff --git a/routes/mobile-sections.js b/routes/mobile-sections.js
index bd0eaf3..c4c82da 100644
--- a/routes/mobile-sections.js
+++ b/routes/mobile-sections.js
@@ -83,6 +83,9 @@
     var hatnote;
     if ( hatnoteNode ) {
       hatnote = hatnoteNode.innerHTML;
+      // Strip it from the output inside the section text
+      hatnoteNode.parentNode.removeChild( hatnoteNode );
+      input.page.sections[0].text = lead.body.innerHTML;
     }
 
     return {
diff --git a/test/features/mobile-sections-lead/pagecontent.js 
b/test/features/mobile-sections-lead/pagecontent.js
index c948a3c..53e07b1 100644
--- a/test/features/mobile-sections-lead/pagecontent.js
+++ b/test/features/mobile-sections-lead/pagecontent.js
@@ -145,6 +145,8 @@
                 assert.ok(res.body.hatnote,
                     'See also: <a href="/wiki/Military_order_(society)" 
title=\"Military order (society)">Military order (society)</a>',
                      'hatnote property present on lead.');
+                assert.ok(res.body.sections[0].text.indexOf('<div 
class="hatnote">') === -1,
+                 'Hatnote should not appear in lead section html.');
             });
     });
 });

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If1dc94ec7b67e1904e6ea0e4ae025c9b612c2b9e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/services/mobileapps
Gerrit-Branch: master
Gerrit-Owner: Jdlrobson <jrob...@wikimedia.org>

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

Reply via email to