Functions for modifying a unified-latex AST
npm install @unified-latex/unified-latex-util-render-infoFunctions to help modify the _renderInfo of a unified-latex Abstract Syntax Tree (AST).
If you want to compare the structure of an AST without position information or extra information
that is kept for pretty-printing, these functions can be used to remove/modify the _renderInfo
of an Ast.Node.
``bash`
npm install @unified-latex/unified-latex-util-render-info
This package contains both esm and commonjs exports. To explicitly access the esm export,
import the .js file. To explicitly access the commonjs export, import the .cjs file.
Removes any _renderInfo and position tags present in the AST. This
operation is destructive.
`typescript`
function trimRenderInfo
Parameters
| Param | Type |
| :---- | :-------- |
| ast | Ast.Ast |
Updates the ._renderInfo property on a node to includerenderInfo
whatever has been supplied to . If renderInfo
is null, no update is performed.
This operation mutates node
`typescript`
function updateRenderInfo(
node: Ast.Node | Ast.Argument,
renderInfo: {}
): Ast.Node | Ast.Argument;
Parameters
| Param | Type |
| :--------- | :------------------------- |
| node | Ast.Node \| Ast.Argument |{}` |
| renderInfo |