Syntax highlighting now works.
All checks were successful
Build Tavernworks / Explore-Gitea-Actions (push) Successful in 2m59s

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.
This commit is contained in:
2026-01-17 19:12:59 -05:00
parent e4b72f6580
commit ceec758be5
2 changed files with 3 additions and 8 deletions

View File

@ -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"

View File

@ -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
}
}
}