Last modified: 2014-10-03 14:54:01 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T72196, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 70196 - Some categories are not represented in Parsoid output
Some categories are not represented in Parsoid output
Status: RESOLVED FIXED
Product: Parsoid
Classification: Unclassified
General (Other open bugs)
unspecified
All All
: Normal normal
: ---
Assigned To: Marc Ordinas i Llopis
:
Depends on: 71490
Blocks:
  Show dependency treegraph
 
Reported: 2014-08-29 22:22 UTC by Jackmcbarn
Modified: 2014-10-03 14:54 UTC (History)
5 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Jackmcbarn 2014-08-29 22:22:31 UTC
Some parser functions (and other things) add tracking categories directly, rather than emitting the wikitext [[Category:whatever]] and letting the parser add them. Parsoid currently doesn't include these categories when it parses pages. To fix this, when it calls the API's expandtemplates, it needs to request and use its "categories" output. A simple way to test this is to add {{#invoke:this is invalid}} to a page. If this bug is fixed, the page will end up in Category:Pages_with_script_errors.
Comment 1 Marc Ordinas i Llopis 2014-10-01 12:18:57 UTC
How should these "hidden" categories be represented in Parsoid's HTML?

As a proof of concept, I've pushed https://gerrit.wikimedia.org/r/#/c/164054/ which adds each one of them as a <link rel="mw:PageProp/Category"> in the page's <head>.
Comment 2 ssastry 2014-10-01 13:45:56 UTC
If the expandtemplates call gives you the categories for the expansion (template / extension), you can add them as part of the template/expansion output itself.

For extensions, this should be straightforward since you get expanded HTML back and you can add these categories as well.

For template output ...  we should chat about it .. but you could update the wikitext with category wikitext that you generate and append to the expanded wikitext so that when it gets parsed, it gets wrapped as part of the template.
Comment 3 Gerrit Notification Bot 2014-10-01 17:52:19 UTC
Change 164054 had a related patch set uploaded by Marcoil:
Bug 70196: Add tracking categories from extensions to <head>

https://gerrit.wikimedia.org/r/164054
Comment 4 Gerrit Notification Bot 2014-10-01 18:33:19 UTC
Change 164054 merged by jenkins-bot:
Bug 70196: Add categories added directly from extensions

https://gerrit.wikimedia.org/r/164054
Comment 5 Jackmcbarn 2014-10-01 22:39:58 UTC
This doesn't quite work right. Details on the gerrit change.
Comment 6 Gerrit Notification Bot 2014-10-02 14:20:01 UTC
Change 164333 had a related patch set uploaded by Marcoil:
Bug 70196: Add all categories from action=parse

https://gerrit.wikimedia.org/r/164333
Comment 7 Gerrit Notification Bot 2014-10-02 15:17:17 UTC
Change 164333 merged by jenkins-bot:
Bug 70196: Add all categories from action=parse

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

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links