Function htmlize::escape_all_quotes_bytes
source · pub fn escape_all_quotes_bytes<'a, S: Into<Cow<'a, [u8]>>>(
input: S
) -> Cow<'a, [u8]>
Expand description
Escape a byte string including both single and double quotes.
Generally, it is safe to leave single quotes (apostrophes) unescaped, so you
should use escape_text_bytes()
or escape_attribute_bytes()
.
use htmlize::escape_all_quotes_bytes;
assert_eq!(
escape_all_quotes_bytes(b"test: &<>\"'".as_slice()),
b"test: &<>"'".as_slice()
);
To work with String
instead of bytes, see escape_all_quotes()
.