From ceec758be5d83ae381e9bcbcec8bb3cb34b1f886 Mon Sep 17 00:00:00 2001 From: Myrddin Dundragon Date: Sat, 17 Jan 2026 19:12:59 -0500 Subject: [PATCH] Syntax highlighting now works. When a blog post is now loaded it will run the effect to call the Highlight.js code. This is purely a side effect so we do not care about checking if it works. --- bard/Cargo.toml | 2 +- bard/src/components/post.rs | 9 ++------- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/bard/Cargo.toml b/bard/Cargo.toml index d44b8ac..ef3710b 100644 --- a/bard/Cargo.toml +++ b/bard/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "bard" -version = "0.3.19" +version = "0.3.20" edition = "2024" description = "Dioxus components that will display a Tavern blogging system Blog." repository = "/CyberMages/tavern" diff --git a/bard/src/components/post.rs b/bard/src/components/post.rs index 20b2dce..31ee88e 100644 --- a/bard/src/components/post.rs +++ b/bard/src/components/post.rs @@ -130,12 +130,7 @@ pub fn Story(text: String) -> Element { use_effect(|| { - spawn(async - { - document::eval("hljs.highlightAll();") - .await - .expect("Error highlighting code"); - }); + document::eval("hljs.highlightAll();"); }); rsx! @@ -144,7 +139,7 @@ pub fn Story(text: String) -> Element { class: "blog_post_tale", - dangerous_inner_html: "{text}" + dangerous_inner_html: text } } }