magic! now it works on web kit

This commit is contained in:
りき萌 2024-03-03 21:23:37 +01:00
parent 33416e8963
commit 3a4eb87ca0
17 changed files with 164 additions and 116 deletions

View file

@ -527,7 +527,8 @@ where
escape_html(&mut self.writer, &branch.attributes.id)?;
self.writer.write_str("\">")?;
}
self.writer.write_str("<img is=\"th-emoji\" title=\":")?;
self.writer
.write_str("<img data-cast=\"emoji\" title=\":")?;
escape_html(&mut self.writer, name)?;
self.writer.write_str(":\" src=\"")?;
escape_html(&mut self.writer, &self.config.site)?;

View file

@ -45,9 +45,9 @@ pub fn branch_to_html(
}
let component = if let Content::Link(_) = branch.attributes.content {
"th-b-linked"
"b-linked"
} else {
"th-b"
"b"
};
let linked_branch = if let Content::Link(link) = &branch.attributes.content {
@ -64,7 +64,7 @@ pub fn branch_to_html(
write!(
s,
"<li is=\"{component}\" class=\"{class}\" id=\"{}\"{linked_branch}{do_not_persist}>",
"<li data-cast=\"{component}\" class=\"{class}\" id=\"{}\"{linked_branch}{do_not_persist}>",
EscapeAttribute(&branch.html_id)
)
.unwrap();

View file

@ -107,7 +107,7 @@ pub enum Content {
#[derive(Debug, Default, Clone, PartialEq, Eq, Deserialize)]
pub struct Classes {
/// Classes to append to the branch itself (<li is="th-b">).
/// Classes to append to the branch itself (<li data-cast="b">).
#[serde(default)]
pub branch: String,