Create a new render context from a parsed syntax tree.
The syntax tree produced by the parser. Footnotes, styles, html-blocks, and table-of-contents data are extracted from the tree and stored for later use by element renderers.
Caller-supplied render configuration. Missing fields fall back to safe defaults.
ReadonlybibliographyOrdered bibliography definition-list entries from [[bibliography]] blocks.
ReadonlybibliographyMap from bibliography label to its 1-indexed citation number.
ReadonlyfootnotesFootnote element arrays collected from the syntax tree.
ReadonlyhtmlRaw HTML strings for [[html]] blocks, indexed by insertion order.
ReadonlyoptionsFull render options supplied by the caller.
ReadonlysettingsMerged wikitext settings (page-mode defaults when omitted).
ReadonlystylesCSS <style> blocks extracted from the syntax tree.
ReadonlytocPre-built TOC element tree for [[toc]] rendering.
The page context for the current render, if provided. Contains page name, site, tags, and a page-existence checker.
Generate a fixed element ID (no index). When useTrueIds is false, appends a random suffix.
Generate an element ID.
When useTrueIds is true, returns ${prefix}${index}.
When false, appends a random suffix to prevent collisions across fragments.
Join all buffered HTML fragments and return the final HTML string.
The complete rendered HTML output.
Advance the bibliography citation counter and return the new value.
Used to generate unique bibcite-N-XXXXX element IDs.
The counter value after incrementing (1-based).
Return the current equation index and advance the counter.
The index before incrementing (0-based).
Return the current footnote index and advance the counter.
The index before incrementing (0-based).
Return the current HTML block index and advance the counter.
The index before incrementing (0-based).
Return the current TOC heading index and advance the counter.
The index before incrementing (0-based).
Append a raw HTML string to the output buffer without escaping.
Trusted HTML fragment to append.
HTML-escape the given text and append it to the output buffer.
Untrusted text content (will be entity-escaped).
Sanitize and render an attribute map to an HTML attribute string.
Dangerous attributes (event handlers, unsafe URLs) are stripped by
sanitizeAttributes. Each surviving key-value pair is escaped
and formatted as key="value".
Raw attribute map from the AST.
A string of HTML attributes with a leading space, or "" if empty.
Resolve an ImageSource to a concrete src URL string.
Wikidot supports several image source forms:
url -- a direct URL or local pathfile1 -- a file attached to the current page (/local--files/{page}/{file})file2 -- a file attached to a named pagefile3 -- a file on a named site and pageLocal paths (starting with / but not //) and file-type sources are
blocked when allowLocalPaths is false in the settings.
The image source descriptor from the AST.
The resolved URL, or null if the source is blocked by settings.
Resolve a LinkLocation to an href string.
Handles plain URL strings and structured PageRef objects. For page
references the page name is normalized to lowercase, spaces are replaced
with hyphens, and slashes become hyphens (Wikidot URL convention).
Anchors (#) and cross-site references (site field) are handled.
A raw URL string or a PageRef object from the AST.
The resolved href string, always starting with / for local
pages or https:// for cross-site links.
Manages rendering state and accumulates HTML output for a single render pass.
The context is created once per call to
renderToHtmland threaded through every element renderer. It provides:bibliography-blockelements, assigning continuous 1-indexed citation numbers across blocks