From 12d3a86c3976db81929e26ee96afa5ca2ad1c5d6 Mon Sep 17 00:00:00 2001 From: Xe Iaso Date: Sat, 21 Jan 2023 15:42:53 -0500 Subject: support xedn resizable stickers Signed-off-by: Xe Iaso --- lib/xesite_markdown/src/lib.rs | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) (limited to 'lib/xesite_markdown/src') diff --git a/lib/xesite_markdown/src/lib.rs b/lib/xesite_markdown/src/lib.rs index 941761d..0767c30 100644 --- a/lib/xesite_markdown/src/lib.rs +++ b/lib/xesite_markdown/src/lib.rs @@ -111,16 +111,23 @@ pub fn render(inp: &str) -> Result { .ok_or(Error::MissingElementAttribute("mood".to_string()))?; let name = name.replace("_", " "); - el.before(&format!(r#" + let (size, class) = el + .get_attribute("standalone") + .map_or((64, "conversation-smol"), |_| { + (128, "conversation-standalone") + }); + + el.before( + &format!( + r#"
-
- - - - {name} is {mood} - +
+ {name} is {mood}
-
<{name}> "#), ContentType::Html); +
<{name}> "# + ), + ContentType::Html, + ); el.after("
", ContentType::Html); el.remove_and_keep_content(); -- cgit v1.2.3