// This file mirrors the implementation of `src/elements/htmlTemplates.ts`.
// Any changes to the templates here must be synchronized with `htmlTemplates.ts`.
pub const TEMPLATE_SCROLL_VIEW: &str = r#"
"#;
pub const TEMPLATE_X_AUDIO_TT: &str = r#" "#;
pub fn template_x_image(src: Option<&str>) -> Result {
if let Some(src_str) = src {
let has_xss = src_str
.to_lowercase()
.split('<')
.skip(1)
.any(|part| part.trim_start().starts_with("script"));
if has_xss {
return Err(
"detected "#
))
} else {
Ok(r#" "#.to_string())
}
}
pub fn template_filter_image(src: Option<&str>) -> Result {
template_x_image(src)
}
pub const TEMPLATE_X_INPUT: &str = r#"
"#;
pub const TEMPLATE_X_LIST: &str = r#"
"#;
pub const TEMPLATE_X_OVERLAY_NG: &str = r#"
"#;
pub const TEMPLATE_X_REFRESH_VIEW: &str = r#"
"#;
pub const TEMPLATE_X_SWIPER: &str = r#"
"#;
pub const TEMPLATE_X_TEXT: &str = r#"
"#;
pub fn template_inline_image(src: Option<&str>) -> Result {
template_x_image(src)
}
pub const TEMPLATE_X_TEXTAREA: &str = r#"
"#;
pub const TEMPLATE_X_VIEWPAGE_NG: &str = r#"
"#;
pub const TEMPLATE_X_WEB_VIEW: &str = r#"
"#;
pub fn template_x_svg() -> String {
r#" "#.to_string()
}