Add svg and mathml support

This commit is contained in:
Joscha 2024-11-26 23:42:10 +01:00
parent cc3f85e6e1
commit 43b3236d3b
6 changed files with 150 additions and 8 deletions

View file

@ -63,8 +63,13 @@ pub struct Element {
impl Element {
pub fn new(name: impl ToString, kind: ElementKind) -> Self {
let mut name = name.to_string();
if kind == ElementKind::Foreign {
name = name.to_ascii_lowercase()
}
Self {
name: name.to_string().to_ascii_lowercase(),
name,
kind,
attributes: BTreeMap::new(),
children: vec![],