Generates an Abstract Syntax Tree (AST) from a chunk of BBCode.
Read full and updated documentation:https://pythoncoderas.github.io/bbcode-ast/
npminstall--savebbcode-astLoad the library fromhttps://cdn.jsdelivr.net/npm/bbcode-ast@2/dist/bundle.min.js.
This will add abbcode_ast variable to thewindow global. The default parser can be accessed throughbbcode_ast.default.
You can either use the default parser or construct your own parser. Once you have aParser, call theparse method onit. The default parser can be imported.
It will return the root node of the AST.
You can navigate through the tree by accessing thechildren attribute of the root node and recursively inspectingthechildren of child nodes.
Generated usingTypeDoc