Skip to main content

AST

Affects parser plugins and custom rules that read AST tokens. The DOM layer (MLElement, MLToken getters startOffset / endOffset, etc.) is unchanged.

Changev4v5
Start positionstartOffset, startLine, startColoffset, line, col
End positionendOffset, endLine, endColDerive from offset + raw, or @markuplint/parser-utils/location (getEndLine, getEndCol, getEndPosition)
Self-closingselfClosingSolidustagCloseChar starts with /
ConditionalsconditionalTypeblockBehavior?.type (MLASTBlockBehavior)
Parser typeMLMarkupLanguageParser / ParseMLParser
getNamespace@markuplint/html-parser (tagName, parentNamespace?)@markuplint/parser-utils (currentNodeName, parentNode)
Parent/pair referenceparentNode / pairNode (object reference)parentNodeUuid / pairNodeUuid (string); resolve against MLASTDocument.nodeList
Unquoted value terminator/ also terminates the valueOnly whitespace / > terminate; / stays part of the value (HTML LS — attribute value (unquoted) state)

endOfUnquotedValueChars (parser-utils attrTokenizer() / visitAttr()) no longer includes / by default. Bundled parsers that rely on the default — html-parser, vue-parser, ejs-parser, astro-parser, mdx-parser, jsx-parser, svelte-parser — now keep / as part of an unquoted attribute value instead of splitting on it (for example <img src=path/to/file.png> no longer truncates the value at the first /). pug-parser passes its own endOfUnquotedValueChars: [] and is unaffected. A custom parser or rule that called attrTokenizer() / visitAttr() and relied on / terminating the value must pass endOfUnquotedValueChars explicitly.