From @Tgr's comment in https://gerrit.wikimedia.org/r/#/c/377349/4/lib/parsoidSectionsUsingDivs.js@78
doc.querySelectorAll('div[id^=section]');
use a data-mw-* attribute or at least prefix the id with mw-
From @Tgr's comment in https://gerrit.wikimedia.org/r/#/c/377349/4/lib/parsoidSectionsUsingDivs.js@78
doc.querySelectorAll('div[id^=section]');
use a data-mw-* attribute or at least prefix the id with mw-
Status | Subtype | Assigned | Task | ||
---|---|---|---|---|---|
Resolved | None | T169242 Develop Page Content Service for Reading Clients | |||
Resolved | • Jhernandez | T177424 Develop Compatibility Layer of PCS | |||
Resolved | • bearND | T162179 Extract HTML Compatibility Layer from MCS Mobile Sections API | |||
Declined | None | T175742 Consider using data-mw-* attribute for section ids in parsoidSectionsUsingDivs |
Won't all logic depending on the structure of data-mw JSON potentially break anytime the underlying template changes?
I was debating whether to use an element's class name or a value plucked from data-mw JSON in a recent patch, and settled on relying on the resulting class name rather than the data-mw for that reason.
Ah, never mind, on second read I guess the context here is a little different; this seems specifically about section parsing.
Right. This task is (maybe i should say was) more about using something like data-mw-section-id. I think we could probably get rid of the parse sections by div thing altogether.