aboutsummaryrefslogtreecommitdiff
path: root/src/app
diff options
context:
space:
mode:
Diffstat (limited to 'src/app')
-rw-r--r--src/app/markdown.rs9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/app/markdown.rs b/src/app/markdown.rs
index e69b6e7..f6ae342 100644
--- a/src/app/markdown.rs
+++ b/src/app/markdown.rs
@@ -7,7 +7,7 @@ use comrak::{
ComrakPlugins,
};
use lazy_static::lazy_static;
-use lol_html::{rewrite_str, element, RewriteStrSettings, html_content::ContentType};
+use lol_html::{element, html_content::ContentType, rewrite_str, RewriteStrSettings};
use std::cell::RefCell;
use url::Url;
@@ -80,7 +80,7 @@ pub fn render(inp: &str) -> Result<String> {
let name = el.get_attribute("name").expect("wanted xeblog-conv to contain name");
let name_lower = name.clone().to_lowercase();
let mood = el.get_attribute("mood").expect("wanted xeblog-conv to contain mood");
-
+
el.before(&format!(r#"
<div class="conversation">
<div class="conversation-picture conversation-smol">
@@ -95,6 +95,11 @@ pub fn render(inp: &str) -> Result<String> {
el.remove_and_keep_content();
Ok(())
+ }),
+ element!("xeblog-hero", |el| {
+ let file = el.get_attribute("file").expect("wanted xeblog-hero to contain file");
+ el.replace(&crate::tmpl::xeblog_hero(file, el.get_attribute("prompt")).0, ContentType::Html);
+ Ok(())
})
],
..RewriteStrSettings::default()