Dbrant has uploaded a new change for review. (
https://gerrit.wikimedia.org/r/366029 )
Change subject: Tweak processing of compilations for newer Zim files.
......................................................................
Tweak processing of compilations for newer Zim files.
Zim files provided by Kiwix that have been created more recently than ~May
2017 are in a slightly different format than older Zim files, since they
are now fetching the HTML from the Content Service endpoint rather than
plain Parsoid. This includes the recently-updated Medical compilations
available from Kiwix.
Amazingly, the format of the HTML is still similar enough that our current
post-processing of it doesn't require a whole lot of changes, except for
an <H1> element that appears at the top of the article.
This patch tweaks our post-processing to simply skip over the H1 element.
Note that we shouldn't plan on doing a whole lot more custom transforms on
Zim compilations, since we'll eventually build our own compilations
composed from Content Service responses. However, this change is simple
enough that it warrants inclusion, if only to ensure near-term
compatibility with existing Zim files that come from Kiwix.
Change-Id: I674bde0500d2395f45e050ec4cec01eeaca046c6
---
M app/src/main/assets/bundle.js
M www/js/sections.js
2 files changed, 2 insertions(+), 2 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/apps/android/wikipedia
refs/changes/29/366029/1
diff --git a/app/src/main/assets/bundle.js b/app/src/main/assets/bundle.js
index 10521ad..c64b4ee 100644
--- a/app/src/main/assets/bundle.js
+++ b/app/src/main/assets/bundle.js
@@ -608,7 +608,7 @@
contentElem.appendChild( currentSectionNode );
for ( i = 0; i < zimNodes.length; i++ ) {
- if (zimNodes[i].tagName === undefined) {
+ if (zimNodes[i].tagName === undefined || zimNodes[i].tagName === 'H1')
{
continue;
}
diff --git a/www/js/sections.js b/www/js/sections.js
index 66b7a64..6a0e72d 100644
--- a/www/js/sections.js
+++ b/www/js/sections.js
@@ -256,7 +256,7 @@
contentElem.appendChild( currentSectionNode );
for ( i = 0; i < zimNodes.length; i++ ) {
- if (zimNodes[i].tagName === undefined) {
+ if (zimNodes[i].tagName === undefined || zimNodes[i].tagName === 'H1')
{
continue;
}
--
To view, visit https://gerrit.wikimedia.org/r/366029
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I674bde0500d2395f45e050ec4cec01eeaca046c6
Gerrit-PatchSet: 1
Gerrit-Project: apps/android/wikipedia
Gerrit-Branch: master
Gerrit-Owner: Dbrant <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits