Page MenuHomePhabricator

Tag problematic pages with tracking category
Closed, ResolvedPublic3 Estimated Story Points

Description

Following T356899#9565909 one way to detect errors with background being defined without color, is the ParserAfterTidy hook, which is invoked by the legacy parser. It is not invoked by Parsoid, but the legacy parser is used post-edit and on almost all page views. This hook occur before caching and before the links update jobs, so it's an excellent place to add a tracking category (git grep nonnumeric-formatnum includes/ in core for an idea how this works). Editors use the category lists on-wiki to chase down and fix errors. Because this hook is (a) not invoked by Parsoid, and (b) affects pre-cache content, it's not a great place to make changes to the HTML output, but it's a fine place to tweak metadata like categories. The full HTML for the article, including styles added by TemplateStyles, should be available here, and attributes are guaranteed to be double-quoted and so a quick-and-dirty regexp like \bstyle="([^"]*(background-?)color)[^"]*" might be enough to pull up the lion's share of the problematic uses.

TODO

  • Run a regex on page content on edits that adds a tracking category to the page

QA

It should be possible to visit [[Category:T358387]] and see all pages impacted by this issue.

Further reading

Event Timeline

Jdlrobson created this task.
Jdlrobson updated the task description. (Show Details)
Jdlrobson changed the task status from Open to Stalled.Feb 27 2024, 5:28 PM

The plan is to attempt T358238 first and check in later whether we need to do this one instead based on how that is going.

Jdlrobson claimed this task.

We do not need this anymore. The linter rules seem like a better approach here.