Parsoid translate back-and-forth between wikitext syntax and an equivalent HTML document. By so doing identifies some errors which the linter extension can now track and show an editor with some hints for fixing.
I started by learning the DOM and the tree data structure, the Document Object Model (DOM) is a programming interface for HTML and XML documents by definition. It allows a programming language to manipulate the content, style and structure of a website. The browser creates a representation of the document known as the Document Object Model.
The DOM consist of a tree of objects called nodes and there are many types of nodes but the three main types are: element, comment and text nodes. The particularity of the element node is that it can have child nodes (but can also be leaves if they don’t have children) whereas comment and text nodes can only be leaves.
The document object is the root of every node in the DOM and is a property of the window object which is the top-level object representing a tab in the browser. The root element that every document will contain include: document, document.documentElement, document.head, document.body. Apart from these root nodes there exist other nodes like the parent nodes, the children nodes and the sibling nodes with their different properties to help traverse the DOM.
Knowing the markup language HTML, the tree data structure, the DOM together with the methods of accessing and traversing the DOM we are good to go for studying Parsoid code for the existing Linter categories. See you there!