@wdprlib/decompiler
    Preparing search index...

    @wdprlib/decompiler

    @wdprlib/decompiler

    Decompiler for Wikidot markup.

    bun add @wdprlib/decompiler
    
    import { decompile } from "@wdprlib/decompiler";

    // HTML → Wikidot syntax
    const wikidot = decompile("<p><strong>Hello</strong> world</p>");
    // => "**Hello** world"
    import { htmlToAst, serialize } from "@wdprlib/decompiler";

    // 1. HTML → AST
    const tree = htmlToAst("<p>Hello</p>");

    // 2. Inspect or transform the AST...

    // 3. AST → Wikidot syntax
    const wikidot = serialize(tree);

    Converts HTML to Wikidot syntax in one call (HTML → AST → serialize).

    Converts HTML to a Wikidot AST (SyntaxTree). Footnote content is extracted and stored in tree.footnotes.

    Converts a Wikidot AST to markup text.

    • Best-effort conversion: re-parsing the output should produce structurally equivalent HTML
    • Code block language detection from highlighted HTML is not supported
    • Modules ([[module ...]]), includes, iftags, comments are out of scope

    AGPL-3.0 - See LICENSE