fn escape_page_data(data: &str) -> String {
    data.to_string()
        // We escape any backslashes to prevent their interfering with JSON delimiters
        .replace(r#"\"#, r#"\\"#)
        // We escape any backticks, which would interfere with JS's raw strings system
        .replace(r#"`"#, r#"\`"#)
        // We escape any interpolations into JS's raw string system
        .replace(r#"${"#, r#"\${"#)
}
/// Escapes special characters in page data that might interfere with JavaScript processing.
Escapes special characters in page data that might interfere with JavaScript processing.
Escapes special characters in page data that might interfere with JavaScript processing .
fn escape_page_data(data: &str) -> String {
    data.to_string()
        // We escape any backslashes to prevent their interfering with JSON delimiters
        .replace(r#"\"#, r#"\\"#)
        // We escape any backticks, which would interfere with JS's raw strings system
        .replace(r#"`"#, r#"\`"#)
        // We escape any interpolations into JS's raw string system
        .replace(r#"${"#, r#"\${"#)
}
fn escape_page_data ( data : & str ) -> String { data . to_string ( ) // We escape any backslashes to prevent their interfering with JSON delimiters . replace ( r#"\"# , r#"\\"# ) // We escape any backticks, which would interfere with JS's raw strings system . replace ( r#"`"# , r#"\`"# ) // We escape any interpolations into JS's raw string system . replace ( r#"${"# , r#"\${"# ) }
Escapes special characters in page data that might interfere with JavaScript processing.
Escapes special characters in page data that might interfere with JavaScript processing .
data
&str
data
&str