Page MenuHomePhabricator

Linter: check for <a> tags (checkwiki #4)
Open, MediumPublic

Description

checkwiki #4: The article contains one or more <a> tags, should use wikicode [...] instead.

Maybe this could be general for any HTML tag that is not allowed, but has a wikitext equivalent like <img> ?

Event Timeline

Arlolra triaged this task as Medium priority.Jan 20 2017, 3:05 AM

More generally, we should probably lint for any tag which is not on the whitelist. <img> is another.

More generally, we should probably lint for any tag which is not on the whitelist. <img> is another.

MediaWiki can have custom tags, like <gallery>, including ones introduced by extensions (<mapframe>, <maplinks>), etc. This category should be based on a list of specific tags, that can be represented by wikitext (like <table>). This category will be very useful.

More generally, we should probably lint for any tag which is not on the whitelist. <img> is another.

MediaWiki can have custom tags, like <gallery>, including ones introduced by extensions (<mapframe>, <maplinks>), etc.

The request is specific to HTML tags which are not passed through the whitelist. <img>, <a>, perhaps others. Custom tags are irrelevant.

This category should be based on a list of specific tags, that can be represented by wikitext (like <table>). This category will be very useful.

Not really? We have a large number of templates which emit the HTML rather than the wikitext. It's a reasonable request for mainspace only, but Linter doesn't care where the lint is and even indicates that you should go hunt it down elsewhere if it's not directly in the page. This is bad for the Linter project; Checkwiki has this check and should continue to have this check for mainspace.

In addition, there isn't a 1:1 feature parity between wikitext and the underlying HTML tag it implements; list markup is probably the most obvious example of this - there is no way to specify HTML attributes or CSS in list wikimarkup (other than using wrapper elements like <span>, which still doesn't let you do stuff like set a custom start number for ordered lists). Because of this, I agree that the Linter category should just track nonwhitelisted HTML elements.

In addition, there isn't a 1:1 feature parity between wikitext and the underlying HTML tag it implements; list markup is probably the most obvious example of this - there is no way to specify HTML attributes or CSS in list wikimarkup (other than using wrapper elements like <span>, which still doesn't let you do stuff like set a custom start number for ordered lists).

Wikitext also has internal whitespace trimmed.

(OT: Obligatory advert for T202083: First-class wikitext support for ordered list item value.)