Page MenuHomePhabricator

Invalid TOC data from ar.wiktionary.org
Closed, InvalidPublicBUG REPORT

Description

We're getting odd looking TOC values back from MCS:
https://ar.wiktionary.org/api/rest_v1/page/mobile-sections/%D8%B7%D9%8E%D9%84%D9%8E%D8%A8%D9%8E

Some ids are -1
And I believe it's invalid for the toclevel to be less than 1 (sometimes is 0).

I'm not sure how it's supposed to function, but based on other examples, the above behaviour looks wrong.

Original Issue: https://github.com/openzim/mwoffliner/issues/872

Thanks Guys

Event Timeline

Isnit001 created this task.Jul 9 2019, 2:17 PM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Kelson added a subscriber: Kelson.Jul 9 2019, 3:53 PM
bearND closed this task as Invalid.EditedJul 17 2019, 4:22 PM
bearND added a subscriber: bearND.

0 is the lead section, -1 are uneditable sections, -2 are Pseudo sections, as determined by Parsoid[1]. The negative ones are usually transcluded headings.
One approach could be to not include these in the actually displayed ToC.

[1] https://www.mediawiki.org/wiki/Parsing/Notes/Section_Wrapping#Plan_of_Record:_Implementation_proposal

@bearND Thank you for the explanation