Right now all the pages in Category:Pages using invalid self-closed HTML tags are JavaScript pages. That's because $("<div />") is perfectly valid in JavaScript (and commonly used). The Sanitizer function that puts pages in that category, removeHTMLtags(), is intended to be sanitizing for HTML5, not JavaScript. JS pages should either be exempt from that function entirely or at least the deprecated-self-close-category parts.
Description
Related Objects
Event Timeline
A Javascript to insert such kinds of <div/>s into wikitext is trivial to create. I am unsure that this shouldn't be sanitized.
That aside, @ssastry , Linter doesn't pick these up in its own self-closing test. Does Linter already do it this way?
Also, why are there two systems doing the same thing? 😃
$("<div />") actually inserts <div></div> into the HTML, so there's nothing wrong with it. Regardless, we shouldn't be applying HTML sanitization to JavaScript code.
The root cause here is probably T18683: User CSS/JS should not be parsed for link tables without rendering.
By the way, it is entirely unnecessary to do $("<div />") when you can just do $("<div>"). We recommend the latter in our coding conventions: https://www.mediawiki.org/wiki/Manual:Coding_conventions/JavaScript#Creating_elements. It might be easier to just edit the affected pages.
Linter only processes pages having the wikitext content model.
Also, why are there two systems doing the same thing? 😃
The category preceded linter extension coming online ... and we didn't disable this category since some users were actually relying on it. At this point, we'll let this run its course, and once we replace Tidy, we'll disable this category.
Can I redirect the existing category pages to an appropriate linter page? Can someone work out what that linter URL would be?
For the benefits of other subscribers of this ticket, here is the plan.
Since this category predated the linter extension and is no longer required, the plan is stop adding pages to this category and instead redirect that category page to the linter page since the linter output already handles this tag and also deals with content model constraints.
I would prefer to stop populating the category alone rather than stop populating + a redirect as this will be more confusing to editors ("a Category page that redirects to a Special page?").
Leave a note in tech notices for admins to delete the category because it will no longer be filled, or run a Mediawiki maintenance script to delete it.
This task has been assigned to the same task owner for more than two years. Resetting task assignee due to inactivity, to decrease task cookie-licking and to get a slightly more realistic overview of plans. Please feel free to assign this task to yourself again if you still realistically work or plan to work on this task - it would be welcome!
For tips how to manage individual work in Phabricator (noisy notifications, lists of task, etc.), see https://phabricator.wikimedia.org/T228575#6237124 for available options.
(For the records, two emails were sent to assignee addresses before resetting assignees. See T228575 for more info and for potential feedback. Thanks!)