Skip to main content

decode_script_single_quoted_text_to_string

Function decode_script_single_quoted_text_to_string 

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

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

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

Escapes emitted by the matching encoder are decoded. Hex escapes use \xHH with uppercase digits; only escaped C0 controls and < are decoded. \u2028 and \u2029 are also decoded. Backslashes and ' escaped with a backslash are decoded. Legacy <\/script> and <\!-- escapes are also decoded. Unknown or incomplete escapes are kept, and decoded text is not decoded again.