Hi,
Arlo and myself have been working on a new MediaWiki extension to expose Parsoid's "lint errors" to users.
A little bit of background, Parsoid has a linter that identifies some issues in wikitext that while may not result in user-facing errors, are still not wanted in wikitext. An example might be [[File:Example.png|foo|bar|baz]]. In this case, "foo" and "bar" are ignored, and "baz" is the actual caption - but the bogus image options should be removed. Other errors include missing end tags, obsolete HTML tags, fostered content, etc.
The main advantage of this over tracking categories is that we know the location in the wikitext so it should be easier to identify the error and fix it, as well as knowing whether the issue was caused via a template or not.
The main ticket tracking deployment is https://phabricator.wikimedia.org/T148609.
-- Legoktm
Legoktm wrote:
Arlo and myself have been working on a new MediaWiki extension to expose Parsoid's "lint errors" to users.
[...]
The main advantage of this over tracking categories is that we know the location in the wikitext so it should be easier to identify the error and fix it, as well as knowing whether the issue was caused via a template or not.
Nice.
(I haven't read/skimmed any of the code yet.)
How will the errors be queried? Will be there an api.php module to query on a per-error or per-page basis?
Does the extension distinguish between errors and warnings? Are there gradations of errors? For example, deprecated syntax v. invalid syntax?
I wonder if the name "Linter" is overly generic. This extension will only activate on wikitext, correct? It won't lint other content models/types such as JavaScript and CSS?
MZMcBride
On 10/24/2016 08:42 AM, MZMcBride wrote:
Does the extension distinguish between errors and warnings? Are there gradations of errors? For example, deprecated syntax v. invalid syntax?
Technically, there are no errors with wikitext ... but yes, Parsoid knows what some of these "errors" are and they are tagged with different category names which can be tweaked as necessary. And, other deprecations can be targeted and marked up.
I wonder if the name "Linter" is overly generic. This extension will only activate on wikitext, correct? It won't lint other content models/types such as JavaScript and CSS?
Maybe WikiLint? That could play on the notion that, for most users, wiki = wikitext.
-S.
Hi,
On 10/24/2016 06:42 AM, MZMcBride wrote:
How will the errors be queried? Will be there an api.php module to query on a per-error or per-page basis?
Yes, per-error is implemented, and I've also implemented per-namespace filtering, but not per-page yet.
Does the extension distinguish between errors and warnings? Are there gradations of errors? For example, deprecated syntax v. invalid syntax?
Not really. Each category has a name like "obsolete-tag" or "bogus-image-options", and that's about it.
I wonder if the name "Linter" is overly generic. This extension will only activate on wikitext, correct? It won't lint other content models/types such as JavaScript and CSS?
The Linter extension doesn't care about that at all - it gets told about errors from Parsoid (or any whitelisted service) stores them, and displays them to users. So if someone set up a JSCS service or something to provide errors about JavaScript pages, we could hook up that to Linter. (There's currently only one line of code in Linter that's Parsoid-specific).
-- Legoktm
Legoktm wrote:
Does the extension distinguish between errors and warnings? Are there gradations of errors? For example, deprecated syntax v. invalid syntax?
Not really. Each category has a name like "obsolete-tag" or "bogus-image-options", and that's about it.
There's now https://phabricator.wikimedia.org/T152822.
Subramanya Sastry wrote:
On 10/24/2016 08:42 AM, MZMcBride wrote:
Does the extension distinguish between errors and warnings? Are there gradations of errors? For example, deprecated syntax v. invalid syntax?
Technically, there are no errors with wikitext ... but yes, Parsoid knows what some of these "errors" are and they are tagged with different category names which can be tweaked as necessary. And, other deprecations can be targeted and marked up.
I'm not sure what this technically means. There are no errors with wikitext in what sense?
If I open a <nowiki> tag and there's no closing tag, is that an error? What about partial heading syntax (such as "== foo" at the start of a line) or unclosed HTML comments ("<!--")? Is that considered invalid input?
Is it an error if I input an anchor element or a script element and it's non-functional in output without any warning message or error text or explanation to the user?
Is it an error or at least considered invalid input if there are warnings or even rejection of the edit, in the case of blacklists and abuse filters?
Are you just saying that Parsoid will accept most inputs? Surely it has a size limit, so overly large wikitext would likely be some kind of error?
MZMcBride
wikitech-l@lists.wikimedia.org