Expand description
文章内容组件。 文章内容组件
渲染由服务端生成的文章 HTML 内容,并在 WASM 前端初始化交互脚本。
可运行代码块(markdown 围栏 ```lang runnable)在服务端渲染为带
data-runnable / data-lang / data-overrides / data-source 的 <pre>。
本组件在渲染前把 content_html 拆成片段序列:普通 HTML 文本片段 +
crate::components::code_runner::CodeRunner 组件,使可运行块作为
Dioxus vdom 内的一等元素渲染(而非手动篡改 DOM,避免 hydration 冲突)。
Re-exports§
pub use PostContent_completions::Component::PostContent;
Structs§
- Post
Content Props - Properties for the
PostContentcomponent.
Enums§
- Content
Fragment 🔒 - 内容片段:普通 HTML 文本,或一个可运行代码块。
Functions§
- Post
Content - 文章内容组件。
- decode_
html_ 🔒entities - 解码本场景出现的 HTML 实体(属性值经 escape_html 转义产生)。
- extract_
attr 🔒 - 从 HTML 片段中提取首个
name="value"属性值,并解码 HTML 实体。 仅在单个<pre>块内查找,足够本场景使用。 - split_
content_ 🔒fragments - 把服务端渲染的文章 HTML 拆成
Html/Runnable片段序列。