ssrRaw
Marks a string as trusted markup that escape and ssr insert unchanged.
Marks a string as trusted markup that escape and ssr insert unchanged. Only use it for markup
the application wrote itself, never for user input.
Import#
ts
import { ssrRaw } from "@shadow-js/web/server";
Signature#
ts
function ssrRaw(html: string): SsrNode
Parameters#
| Name | Description |
|---|---|
html |
The markup, inserted unchanged. |
Returns#
The markup as a trusted SsrNode.
Throws#
- TypeError when
htmlis not a string.
Examples#
ts
import { renderToString, ssrRaw } from "@shadow-js/web/server";
const html = renderToString(() => ["<b>escaped</b>", ssrRaw("<!-- build 42 -->")]);
// "<b>escaped</b><!-- build 42 -->"