Page MenuHomePhabricator

Starting TemplateStyles tags are removed in page/mobile-sections
Open, LowestPublic

Description

If the page starts with TemplateStyles tags, they are removed from the output of the lead section when using page/mobile-sections endpoint. The endpoint page/mobile-sections-lead, naturally, has the same problem. I think this is a bug with the mechanism of determining the sections, since page/html and page/mobile-html endpoints get correct output.

I have discovered this issue on the main page of Russian Wikipedia:

The same happens when other sections are present:

Event Timeline

Noting receipt.

Heads up, we're migrating the apps away from the mobile-sections endpoints to mobile-html. The KaiOS app is also undergoing an audit of APIs that it uses and I anticipate we'll explore use of mobile-html there as well.

We're not likely to modify mobile-sections further.

Hmmm, sad to hear it, it seemed to me that this API is easier to use than mobile-html since it doesn’t require as much parsing to get everything. Either way, my job was to report the problem :-)

What info do you need that is not included in mobile-html? There are some getters documented in https://github.com/wikimedia/mobileapps/blob/master/pagelib/docs/pcs/pcs.md.

What info do you need that is not included in mobile-html? There are some getters documented in https://github.com/wikimedia/mobileapps/blob/master/pagelib/docs/pcs/pcs.md.

I was referring to the fact that you need HTML parsing to get different info from mobile-html, as opposed to JSON parsing in mobile-sections. I have not compared the render of both thoroughly, since I just needed some API to get going. (But from what I can see, it is also more prescriptive in its code in comparison? As in, there are even more transforms there.)

MSantos triaged this task as Lowest priority.Feb 23 2021, 3:50 PM