Skip to main content

encode_style_single_quoted_text_to_string

Function encode_style_single_quoted_text_to_string 

Source
pub fn encode_style_single_quoted_text_to_string<S: AsRef<str>>(
    text: S,
    output: &mut String,
) -> &str
Expand description

Encode content of a single-quoted CSS string to a mutable String and return the new string slice.

This appends to output and returns only the new string slice.

The input is raw text; existing escapes are encoded as text. The output is string content and does not include outer quotes. Backslashes and ' are escaped with a backslash. < and C0 controls other than NUL use two uppercase hex digits and one ending space, such as \3C . NUL is replaced with U+FFFD, so text containing NUL cannot round-trip without a change. The ending space is part of the escape; an input space after it is kept. Use the output in a CSS string inside <style>, not in a CSS identifier or an HTML attribute.