For AI agents: the complete documentation index is available at /llms.txt, the full documentation bundle is available at /llms-full.txt, and this page is available as Markdown at /guide/syntax-support.md.
  • English
  • Syntax Support

    This page lists what the default pipeline does with common constructs. Render means structured DOM output; placeholder means the position is kept but nothing is evaluated; degrade means a source card plus a diagnostic; block means dangerous content is dropped with a readable hint; ignore means it never reaches the body.

    With /expand, resolvers, handlers, or component overrides, output changes. Refer to the dedicated pages for details.

    Combined example

    The source below configures no resolvers and covers text, lists, a table, a reference, and the default placeholders:

    Text and lists

    Bold, italic, and an internal link keep their structure.

    • First item
    • Second item

    Table and reference

    Column AColumn B
    CellContent[1]
    Template not expanded: Infobox
    • title=Template placeholder
    File: Example.png
    File placeholder
    1. Example reference↑
    import { Wikitext } from "react-wikitext";
    import "react-wikitext/styles.css";
    
    const source = `== Text and lists ==
    '''Bold''', ''italic'', and an [[internal link|internal link]] keep their structure.
    
    * First item
    * Second item
    
    == Table and reference ==
    {| class="wikitable"
    |-
    ! Column A !! Column B
    |-
    | Cell || Content<ref>Example reference</ref>
    |}
    
    {{Infobox|title=Template placeholder}}
    [[File:Example.png|thumb|File placeholder]]`;
    
    export default function Demo() {
      return <Wikitext source={source} lang="en" />;
    }

    Use the tables to look up a construct; use the example to check the overall output.

    Text and blocks

    ConstructDefault outputStatusNotes
    Paragraphs<p class="wtr-paragraph">RenderTwo or more blank lines split; single newlines collapse
    '''bold''', ''italic''<b>, <i>RenderBoth produce <i><b>…</b></i>
    == Heading ==, source h1–h6<h1>–<h6 class="wtr-heading">RenderParticipates in anchors and the TOC
    ----<hr class="wtr-hr">Render
    Leading spacesPlain textRenderNo preformatted semantics
    <!-- comment -->No outputIgnore
    [[Category:…]]Category footerRenderNot in the body; sort keys are hidden
    __TOC__, __NOTOC__TOC controlRenderOnly affects the TOC
    #REDIRECT on the first lineRedirect bannerRenderSkips the body; does not load the target

    Lists and tables

    ConstructDefault outputStatusNotes
    *, #Nested <ul> / <ol>RenderContinuation lines join the current item
    ;, :<dl> / <dt> / <dd>RenderSupports ; term : definition and compact forms
    {| … |}<table><caption>…</caption><tbody>…RenderCells use <th> / <td>
    Table, row, cell attributesAllowlisted attributesRenderstyle keeps a safe subset; event attributes and id are dropped
    colspan, rowspanLogical grid plus filler cellsRenderClamped to the table; fillers carry compat classes
    Nested wikitext tablesSource cardDegradeThe whole table degrades; nested HTML <table> works
    data-* on tablesSafe values keptRenderReserved names such as data-node-id are rejected
    ConstructDefault outputStatusNotes
    [[Page]]Non-navigable <span class="wtr-link">RenderBecomes <a> when resolveLink returns href
    [[Page|label]]Same, label is labelRenderNamespace prefixes follow the parse result
    [https://example.com label]<a> with rel and targetRenderOnly http:, https:, mailto:
    Bare https://…<a> labelled with the URLRender
    [https://example.com]<a> labelled [N]RenderNumbering is independent of references
    [[File:…]]<span> or <figure> placeholderPlaceholder<img> only after resolveImage
    <gallery>Placeholder set of file labelsPlaceholderNo images are loaded
    <math><code> formula source placeholderPlaceholderNo KaTeX
    <imagemap>Block source cardDegradeNo clickable hotspots

    Templates and functions

    ConstructDefault outputStatusNotes
    {{Template|…}}<details class="wtr-template"> or inline badgePlaceholderLists arguments; text comes from labels.templateNotExpanded
    Parser function {{#if:…}}Placeholder structurePlaceholderExplicitly marked as not evaluated
    Argument {{{name|default}}}Name and default valuePlaceholder
    Templates and functions supported by /expandExpanded source is reparsedRenderCalls kept after a failure still render as placeholders
    #invoke, Lua, substSource preservedPlaceholderNot executed; a diagnostic is recorded

    Magic words inside templates, functions, and arguments do not affect TOC or category detection.

    HTML and extension tags

    ConstructDefault outputStatusNotes
    Inline HTML (b, i, u, span, code, …)Corresponding elementsRenderAttributes are allowlisted
    Block HTML (div, p, blockquote, …)Corresponding elementsRenderMay wrap headings; TOC position follows its block
    Void elements (br, wbr, hr)Corresponding elementsRender
    meta, linkNo outputIgnore
    script, style, iframe, form controls, svgEscaped text, or a readable hint when blockedBlockThe default config does not parse these tags, so source stays text; if configured as HTML, the pair is dropped
    Unknown but not dangerous tagsSource cardDegradeNot rendered as real elements
    <nowiki>Plain textRenderLinks and templates are not parsed
    <pre>Whitespace preservedRender
    <ref><sup class="reference wtr-ref"> plus grouped endnotesRenderNamed references are reused; group groups; duplicates produce diagnostics
    <references>MarkerRenderThe matching group section is moved here; groups without markers stay at the end
    <syntaxhighlight><pre><code class="language-*"> sourceRenderEmits a language class; no syntax highlighting
    Other supported extensionsHandled per tagRendersemanticComponents.extension can override

    Page-level structure

    StructureBehavior
    Table of contentstoc adjusts the threshold; __TOC__ sets the position; __FORCETOC__ forces; __NOTOC__ wins
    Reference sectionAfter the body and before categories by default; <references/> sets a group position
    CategoriesCollected into div.catlinks.wtr-categories at the end
    RedirectFirst-line #REDIRECT renders a banner and skips the body
    Unknown semantic nodesSource card plus a diagnostic; the page keeps rendering

    Verifying behavior

    1. Inspect document.diagnostics for stage and code.
    2. Use flattenNodes from /ast to inspect the semantic tree and compare it with the prepared HAST.
    3. Use labels to distinguish "not evaluated", "blocked", and "unknown structure".
    4. Treat src/ and tests/ as the source of truth; this page follows default behavior.

    See Rendering behavior for details and rationale, and Security model for blocking rules.