diff --git a/Cargo.lock b/Cargo.lock index 60bc764..805d505 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1556,7 +1556,7 @@ dependencies = [ [[package]] name = "rust-web-markdown" version = "0.1.0" -source = "git+https://github.com/rambip/rust-web-markdown/#2ff86f500d89d287f0789e1a02c38fabfbb08213" +source = "git+https://github.com/rambip/rust-web-markdown/#b25a4ba22d92b7f9fe35bc204410d846b3f5f756" dependencies = [ "katex", "lazy_static", diff --git a/src/lib.rs b/src/lib.rs index e49b111..b45b362 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -8,7 +8,7 @@ pub use rust_web_markdown::{ }; -pub type MdComponentProps = WMdComponentProps; +pub type MdComponentProps = WMdComponentProps<'static, MarkdownContext>; use leptos::*; use leptos::html::AnyElement; @@ -26,7 +26,7 @@ pub mod debug { pub struct EventInfo(pub WriteSignal>); } -impl WebFramework for MarkdownContext { +impl WebFramework<'static> for MarkdownContext { type View = View; type HtmlCallback = Callback>; @@ -56,7 +56,7 @@ impl WebFramework for MarkdownContext { &self, e: HtmlElement, inside: Self::View, - attributes: ElementAttributes, + attributes: ElementAttributes<'static, Self>, ) -> Self::View { let mut r: leptos::HtmlElement = match e { HtmlElement::Div => html::div().into_any(), @@ -98,7 +98,7 @@ impl WebFramework for MarkdownContext { r.into_view() } - fn el_hr(&self, attributes: ElementAttributes) -> Self::View { + fn el_hr(&self, attributes: ElementAttributes<'static, Self>) -> Self::View { let mut r = html::hr(); if let Some(s) = attributes.style { @@ -149,7 +149,7 @@ impl WebFramework for MarkdownContext { .append_child(&link).unwrap(); } - fn el_input_checkbox(&self, checked: bool, attributes: ElementAttributes) -> Self::View { + fn el_input_checkbox(&self, checked: bool, attributes: ElementAttributes<'static, Self>) -> Self::View { let mut r = html::input() .attr("type", "checkbox") .attr("checked", checked) @@ -196,7 +196,7 @@ pub fn Markdown( /// #[prop(optional, into)] - render_links: Option, leptos::HtmlElement>>, + render_links: Option, leptos::HtmlElement>>, /// the name of the theme used for syntax highlighting. /// Only the default themes of [syntect::Theme] are supported