# texrender Plugin Plan
**texrender** is a DokuWiki syntax plugin that renders LaTeX pasted directly into wiki source through a real LaTeX engine and embeds the result as inline SVG. It has two syntaxes: `\documentclass{standalone} ... \end{document}` for a figure that gets a line of its own, and `\tikz ... ;` for one small enough to sit in a sentence. This page is the design, the results of verifying the toolchain, and two problems found while verifying it — one of them a security hole that changes the shape of the plugin.
## Verdict up front
Feasible, everything needed is installed, and the pipeline works — I ran it end to end by hand while writing this. The `id` clash you flagged is real and confirmed. But testing turned up a **second, worse problem**: `dvisvgm` will happily emit attacker-supplied raw markup, including `}X
\end{document}
```
The resulting SVG contains, verbatim:
```
```
Embedded inline, that executes in the context of the wiki, with the reader's session. Every page view, for everyone.
The obvious mitigation — disabling the specials with `dvisvgm -S dvisvgm` — **does not work**: PGF/TikZ's DVI-to-SVG driver is itself built on `dvisvgm:raw`, and with specials off the run produced no output file at all. Losing TikZ defeats the purpose of the plugin.
So the SVG must be sanitized before embedding, with an **allowlist**, not a blocklist:
- **Elements**: `svg`, `g`, `defs`, `use`, `path`, `rect`, `circle`, `ellipse`, `line`, `polyline`, `polygon`, `text`, `tspan`, `clipPath`, `mask`, `pattern`, `linearGradient`, `radialGradient`, `stop`, `symbol`, `marker`, `title`, `desc`, `image`. Everything else is dropped, `