fix: turn off InertHtml for SVG/MathML (closes #2998) (#2999)

This commit is contained in:
Greg Johnston 2024-09-19 17:20:30 -04:00 committed by GitHub
parent 27765b417c
commit 96e1fd0fb8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -103,6 +103,12 @@ fn is_inert_element(orig_node: &Node<impl CustomNode>) -> bool {
if el.attributes().is_empty() && el.children.is_empty() {
return false;
}
// also doesn't work if the top-level element is an SVG/MathML element
let el_name = el.name().to_string();
if is_svg_element(&el_name) || is_math_ml_element(&el_name) {
return false;
}
}
_ => return false,
}