Expand description
Markdown 渲染与 HTML 清理。 Markdown 渲染与目录生成。
使用 pulldown-cmark 解析 Markdown,为标题生成锚点与目录(TOC),
代码块调用 highlight 模块进行语法高亮,最终通过 sanitizer 清理 HTML。
仅在 feature = "server" 时执行实际渲染。
Structs§
- Rendered
Content - Markdown 渲染结果。
Functions§
- clean_
html 🔒 - 对外暴露的 HTML 清理函数,委托给 sanitizer 模块。
- escape_
heading_ 🔒text - 将标题纯文本转义,用于安全地拼进 TOC 的
aria-label="..."与<a>正文。 - footnote_
id 🔒 - 将脚注 label 转换为可用于 HTML id / href 锚点的安全标识符。
- generate_
toc_ 🔒html - 根据标题层级生成嵌套目录 HTML。
- render_
markdown_ enhanced - 增强版 Markdown 渲染:生成 TOC、标题锚点与语法高亮代码块。
- slugify_
heading 🔒 - 将标题文本转换为可用于锚点的 slug。
- wrap_
images_ 🔒with_ blur - 把 HTML 里的 /uploads/ 图片转成 blur-up 双层结构。
- wrap_
images_ 🔒with_ blur_ with wrap_images_with_blur的纯函数核心,接受 dimensions 查询闭包以便单测。- wrap_
tables 🔒 - 把每个
<table>...</table>包进可横向滚动的<div class="table-wrap">。