@wdprlib/ast
    Preparing search index...

    @wdprlib/ast

    @wdprlib/ast

    AST types for Wikidot markup.

    bun add @wdprlib/ast
    
    import type { SyntaxTree, Element } from "@wdprlib/ast";
    import { text, paragraph, bold } from "@wdprlib/ast";

    // Create AST nodes
    const tree: SyntaxTree = {
    elements: [paragraph([bold([text("Hello")]), text(" world")])],
    };

    createSettings(mode) supplies safe defaults for parser and renderer capabilities. In every mode, including "page", allowStyleElements defaults to false because [[module CSS]] affects the entire host page. Callers may override it to true only for trusted CSS:

    import { createSettings } from "@wdprlib/ast";

    const settings = {
    ...createSettings("page"),
    allowStyleElements: true,
    };

    Types: SyntaxTree, Element, ElementName, ContainerType, AttributeMap, LinkType, ListType, Module, etc.

    Helpers: text, paragraph, bold, italics, heading, link, list, lineBreak, horizontalRule

    AGPL-3.0 - See LICENSE