Migrating Parsoid code and Getting started with PHP Linter Extension

Hello! hope we are all having a great time here, last time we went through the code that traversed the DOM and could detect links inside links if any existed. Today will go about migrating that code to lib/wt2html/pp/processors/Linter.js in Parsoid.

With all that stated, I think we are good to go. Lets start with the code migration, the first thing is to take into consideration that we will not use the DOMtraverser and its methods, as the Linter has its own traverser and methods which we will use. Basically, all that has to be done is to migrate the handler code to this file and in place of console.log(), use the linter object lintObj and then emit the DSR values via the env.log call. That is all, remember that we already had the code in a standalone file so, we just needed to migrate this code to Parsoid.

Cheers to the completion of the first task!

I’m so excited to start with this PHP Linter Extension, this extension has different linter categories of high, medium and low priority. This is what basically happens, Parsoid finds lint errors in Wikitext and then sends these to the MediaWiki API via the Linter extension which supports these API end points.

The Linter Extension stores this information in the database and provides user access to these lint errors via the Special:LintErrors page.

Now that we already have the code to detect the links inside links, we now need to send this to the MediWiki API via the Linter Extension. We will therefore have to add code to the Linter extension to add this category, so that we can have this new category on the special lint errors page (i.e Wikilinks in Extlinks).

Next post will elaborate more on this new task (adding a Linter Extension)

Related posts

Leave a Comment