https://www.mediawiki.org/wiki/Parsoid/API#Wikitext_-%3E_Lint
"Lint" (syntax check) for wikitext documents of a given title or revision.
https://www.mediawiki.org/wiki/Parsoid/API#Wikitext_-%3E_Lint
"Lint" (syntax check) for wikitext documents of a given title or revision.
Subject | Repo | Branch | Lines +/- | |
---|---|---|---|---|
Implement REST API endpoint for wikitext to lint transform | mediawiki/services/parsoid | master | +43 -14 |
Status | Subtype | Assigned | Task | ||
---|---|---|---|---|---|
Resolved | ssastry | T229015 Tracking: Direct live production traffic at Parsoid/PHP | |||
Resolved | EvanProdromou | T221158 Parsoid REST API in PHP | |||
Resolved | EvanProdromou | T221738 Parsoid REST API routes in MediaWiki | |||
Resolved | BPirkle | T221175 POST /:domain/v3/transform/wikitext/to/lint/:title?/:revision? |
I'm new to Parsoid, so some clarification and context would be helpful.
Finally, while I was typing the above, auto-correct tried to change "linting" to "listing", "lifting", and "tinting" before I gave in and added "linting" to my dictionary. Apologies if I missed correcting any "corrections".
I see that linting can be enabled via $wgParsoidLinting in LocalSettings.php
I don't recall seeing or writing anything like that, and codesearch doesn't know about it either. Maybe Subbu knows more.
when I set "$wgParsoidLinting = true" in my LocalSettings.php, I got errors in src/Wt2Html/PP/Processors/Linter.php. Is this expected?
To the extent that probably no one ever tested this feature of the PHP port before you, yes.
If this is going to be anything like adding the previous two handlers, you should expect some amount of Parsoid/PHP debugging / bugfixing.
I see placeholder code related to this API call in srv/parsoid/extension/src/Rest/Handle/ParsoidHandler.php, function ParsoidHandler::wt2html.
It was added instead of this line. Note that the whole $out / $parse thing doesn't exist in PHP land, and you'll probably have to figure out how to create a way to get linting data in the Parsoid class, or ask the parsing team to do so.
Is there developer-level documentation or Phab info I'm missing where I could have looked up the answers to the above myself?
Probably not, Parsoid/JS is not super well documented in the first place, and the PHP port has even less.
Change 533313 had a related patch set uploaded (by BPirkle; owner: BPirkle):
[mediawiki/services/parsoid@master] Implement REST API endpoint for wikitext to lint transform
Change 533313 merged by jenkins-bot:
[mediawiki/services/parsoid@master] Implement REST API endpoint for wikitext to lint transform
Closing this as the change has been merged.
It is worth nothing (and this is mentioned in the commit message) that the approach I used for passing data from the Parsoid class back to the REST API is non-ideal and should be cleaned up under another task after the Parsoid class interface is finalized.