Esc

escape_text

procedureextensionexperimentalsince 0.36.1Source
  • macOS: escape_text works on macOS
  • Linux: escape_text works on Linux
  • Windows: escape_text works on Windows
  • Wasm: escape_text is not available on Wasm

Escapes ampersands and angle brackets, copying safe runs together.

Signature

escape_text :: (out: *Out, s: string)
Example
out: Out;
defer deinit(*out);
escape_text(*out, "<&>");
assert(to_string(*out) == "&lt;&amp;&gt;");

See also