Issue
It can be quite time consuming coming up with fixes to lint errors.
Proposed solution
Use the parser or cleanup tool to suggest fixes to content. This could be a within a triggered fromSpecial:Linterrors.
The simplest solution is to only suggest an autofix when:
There is simple markup (no templates, parser functions / tag extensions within the snippet);
Simple hacky example for lint error found here (https://www.mediawiki.org/w/index.php?title=User:SPage_(WMF)/VE_span_bug&oldid=1163248) :
var sText = '<p style="font-size: 1.2em; margin-top: 1.2em;">When Vagrant is done configuring your machine, browse to <span class=plainlinks>http://127.0.0.1:8080/</span> to find your MediaWiki instance. The admin password is <code>vagrant<code>.</span>'; disablelimitreport: '1', $.post(window.location.origin + '/w/api.php?action=parse', { format: 'json', text: sText, disableeditsection: '1', disablelimitreport: '1', contentmodel: 'wikitext', formatversion: 2, wrapoutputclass: '' }).then(function(data) { if (data && data.parse && data.parse.templates.length === 0) { $.post(window.location.origin + '/api/rest_v1/transform/html/to/wikitext', { html: data.parse.text }).then(function(data) { console.log("Suggested fix:\n\n" + data); }); } });
Output:
When Vagrant is done configuring your machine, browse to <span class="plainlinks">http://127.0.0.1:8080/</span> to find your MediaWiki instance. The admin password is <code>vagrant</code>.
Currently there doesn't seem to be a way to check if the content contains parser functions or tag extensions. It might be possible to strip manually strip these before testing. Or potentially make that into its own feature request for the API.
It might also be interesting to isolate this cleanup tool (tidy, etc) and expose it as a separate API, assuming it doesn't already exist somewhere.