Page MenuHomePhabricator

Parsoid's Sanitizer overwrites attribute values for template generated attributes which breaks templated magic word properties
Closed, ResolvedPublicBUG REPORT

Description

See discussion in https://gerrit.wikimedia.org/r/c/mediawiki/services/parsoid/+/802208/3/src/Wt2Html/TT/TemplateHandler.php#807

Sanitizer.php:sanitizeTagAttributes is the code in questions.

Event Timeline

ssastry triaged this task as Medium priority.Jun 6 2022, 10:05 PM

Change 803358 had a related patch set uploaded (by Subramanya Sastry; author: Subramanya Sastry):

[mediawiki/services/parsoid@master] TestUtils: Don't strip the content attribute

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

Parsoid's Sanitizer overwrites attribute values for template generated attributes which breaks templated magic word properties

I don't think the sanitizer is at fault here. We're telling it that the html represents the 'content' attribute,
https://github.com/wikimedia/parsoid/blob/master/src/Wt2Html/TT/TemplateHandler.php#L902-L903

Fair, but, there may be some tweaks to Sanitizer code nevertheless since we might end up changing the representation here. The general problem is that we don't have a good representation when more than the attribute is templated (or at least that is how our tokenizer / attribute expander sees it).

Change 803358 merged by jenkins-bot:

[mediawiki/services/parsoid@master] TestUtils: Don't strip the content attribute

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

Change 803367 had a related patch set uploaded (by Arlolra; author: Arlolra):

[mediawiki/services/parsoid@master] Strip parser function prefix from content

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

Change 803367 merged by jenkins-bot:

[mediawiki/services/parsoid@master] Strip parser function prefix from content

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

Change 805225 had a related patch set uploaded (by Arlolra; author: Arlolra):

[mediawiki/vendor@master] Bump parsoid to 0.16.0-a12

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

Change 805225 merged by jenkins-bot:

[mediawiki/vendor@master] Bump parsoid to 0.16.0-a12

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