Expand description
HTML escaping utilities.
Fast-path optimized: scans for first escapable character, then bulk-copies segments between escapes.
Functionsยง
- escape_
attr_ into - Escape HTML attribute value into output buffer.
- escape_
full_ into - Escape HTML text content, checking for quotes as well (for attribute context).
- escape_
text - Escape and return as a new Vec.
- escape_
text_ into - Escape HTML text content into output buffer.
- escape_
text_ to_ string - Escape and return as a String.
- needs_
attr_ escape - Check if a byte slice needs any escaping for attribute values.
- needs_
text_ escape - Check if a byte slice needs any escaping for text content.
- url_
encode_ then_ html_ escape - Characters that need percent-encoding in URLs:
- url_
escape_ link_ destination - Process a link URL: decode entities, handle backslash escapes, and percent-encode.
This is used for link destinations in
[text](url)syntax.