Built-in Node renderers
Import these from slackmark-node/renderers.
MermaidRenderer
| Field | Default | Effect |
|---|---|---|
theme | "default" | Mermaid theme |
backgroundColor | "white" | PNG background |
deviceScaleFactor | 2 | Screenshot pixel density |
maxSourceChars | 50000 | Source limit |
maxEdges | 500 | Graph complexity limit |
maxOutputBytes | 10 MiB | PNG byte limit |
maxWidth, maxHeight | 4096 | Output pixels |
Identity: "mermaid". Language: mermaid. Successful result: PNG bytes.
The renderer uses strict Mermaid security, fixed secure keys, local bundle bytes, CSP, request denial, and pre-screenshot dimension checks.
KatexRenderer
| Field | Default | Effect |
|---|---|---|
backgroundColor | "white" | PNG background |
deviceScaleFactor | 2 | Screenshot pixel density |
fontSizePx | 20 | Formula font size |
paddingPx | 16 | PNG padding |
maxExpand | 1000 | Macro expansion bound |
maxSize | 50 | KaTeX element-size bound |
maxSourceChars | 20000 | Source limit |
maxOutputBytes | 10 MiB | PNG byte limit |
maxWidth, maxHeight | 4096 | Output pixels |
Identity: "katex". Languages: math, katex, latex, tex. Successful result:
PNG bytes.
KaTeX JavaScript, CSS, and fonts load from installed package bytes. Parsing and layout
run inside the cancellable browser context with trust: false.
Both renderers receive source metadata in RenderRequest and cancellation/deadline
state separately in the internal OperationContext argument. Both declare
output: "bytes".