Reference · SVG boards and materials
escapeXmlfunction
Escapes text for safe inclusion in XML attributes and content.
Import it
import { escapeXml } from "@johnmorrisdotca/tobiishi/draw";
Definition
function escapeXml(value: string): string
Parameters
| Name | Type | Description |
|---|---|---|
value | string | Text to escape for XML attributes or content. |
Returns
string
Escapes text for safe inclusion in XML attributes and content.
Examples
import { escapeXml } from "@johnmorrisdotca/tobiishi/draw";
console.log(escapeXml("<peg & hole>"));<peg & hole>What it prints (run when this page was built)