Syntax highlighting now works.
All checks were successful
Build Tavernworks / Explore-Gitea-Actions (push) Successful in 2m59s
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:
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "bard"
|
name = "bard"
|
||||||
version = "0.3.19"
|
version = "0.3.20"
|
||||||
edition = "2024"
|
edition = "2024"
|
||||||
description = "Dioxus components that will display a Tavern blogging system Blog."
|
description = "Dioxus components that will display a Tavern blogging system Blog."
|
||||||
repository = "/CyberMages/tavern"
|
repository = "/CyberMages/tavern"
|
||||||
|
|||||||
@ -130,12 +130,7 @@ pub fn Story(text: String) -> Element
|
|||||||
{
|
{
|
||||||
use_effect(||
|
use_effect(||
|
||||||
{
|
{
|
||||||
spawn(async
|
document::eval("hljs.highlightAll();");
|
||||||
{
|
|
||||||
document::eval("hljs.highlightAll();")
|
|
||||||
.await
|
|
||||||
.expect("Error highlighting code");
|
|
||||||
});
|
|
||||||
});
|
});
|
||||||
|
|
||||||
rsx!
|
rsx!
|
||||||
@ -144,7 +139,7 @@ pub fn Story(text: String) -> Element
|
|||||||
{
|
{
|
||||||
class: "blog_post_tale",
|
class: "blog_post_tale",
|
||||||
|
|
||||||
dangerous_inner_html: "{text}"
|
dangerous_inner_html: text
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user