frontend-markdown-rendering SKILL.md skillB
frontend-markdown-rendering from black-yt/skills is an agent skill: a SKILL.md folder an AI agent loads when a task calls for it.
mdr add black-yt/skills/frontend-markdown-rendering@git:20260605.e763408Pins git:20260605.e763408 in mdr.lock. Pin the fingerprint instead.
- Audit grade
- B, 16 of 17 checks passed
- Kind
- SKILL.md skill
- Repository
- black-yt/skills
- Path
frontend-markdown-rendering/SKILL.md- Versions recorded
- 3
- Latest version
- git:20260605.e763408, committed Jun 5, 2026
- First version recorded
- Jun 3, 2026
- Size
- 11,185 bytes
- Repository stars
- 16
- License
- none declared
当需要在前端把最终 assistant 文本渲染为 Markdown,同时保留工具过程为纯文本/JSON,并支持表格、代码块、图片、KaTeX 公式、Mermaid 图和 workspace 本地图片安全访问时使用。.
Collected from public GitHub. Every version is saved exactly as it was and never changes. Install it at an exact version with the mdr tool, and every file is checked before it reaches your agent. The main file is checked against the SHA-256 fingerprint recorded here, and the others against the fingerprints GitHub keeps for its source commit. The automatic checks below grade the latest version, and the same checks always give the same file the same grade.
What the file says
# Frontend Markdown Rendering
## 核心原则
- 只把最终 assistant 文本当 Markdown 渲染。
- 工具调用、工具输出、中间 trace、错误日志、JSON payload 和流式过程仍按纯文本或 JSON 展示。
- 不要自己手写完整 Markdown parser;组合成熟库。
- Markdown HTML 插入前必须清洗,避免直接插入不可信 HTML。
- 本地 workspace 图片必须通过受 token 保护的后端路由读取,不能直接暴露任意文件路径。
- 图片、表格、Mermaid SVG 都必须限制宽度,避免撑爆右侧或移动端布局。
推荐库:
- Markdown:`marked`
- HTML 安全:`DOMPurify`
- 数学公式:`KaTeX`
- 流程图:`Mermaid`
- 本地图片:后端自建 `/api/workspace-file` 路由
## CDN 依赖
前端可以直接使用 CDN:
```html
<script src="https://cdn.jsdelivr.net/npm/dompurify@3.2.6/dist/purify.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/marked@15.0.12/marked.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/katex.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/contrib/auto-render.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/mermaid@11.12.0/dist/mermaid.min.js"></script>
```
如果页面需要 KaTeX 样式,同时引入 CSS:
```html
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/katex.min.css">
```
如果使用 Mermaid,初始化一次:
```js
mermaid.initialize({
startOnLoad: false,
securityLevel: 'strict',
theme: 'default'
});
```
## 库版本与源码追溯
…Read the whole file at its exact version.
How to install
mdr add black-yt/skills/frontend-markdown-rendering@sha256:0fc4f185f9356de1The line at the top of this page pins the label git:20260605.e763408, which is what most people want. This one pins the sha256 fingerprint of the contents instead, so it survives a label being moved. Either way the exact version is written to mdr.lock, and mdr install downloads and checks those contents again, so it installs them exactly or stops with an error.
[](https://markdownregistry.com/a/art_tpjag5iz3r7nlovk)
3 badge image fetches in 30 days. What the badge shows.
Versions
The registry has recorded 3 versions of this file, between Jun 3, 2026 and Jun 5, 2026, more than one a day.
| version | committed | commit | size | audit | |
|---|---|---|---|---|---|
| git:20260605.e763408 latest | 2026-06-05 | e763408 | 11,185 B | B | view · diff |
| git:20260603.2f9a230 | 2026-06-03 | 2f9a230 | 10,221 B | B | view · diff |
| git:20260603.fc20af9 | 2026-06-03 | fc20af9 | 9,540 B | B | view |
Audit of the latest version
- fail: No script tag (matched: <script)
- pass: Frontmatter block present
- pass: Frontmatter declares a name
- pass: Frontmatter declares a description
- pass: Size between 200 bytes and 200 KB (11185 bytes)
- pass: No zero-width or bidi control characters
- pass: No instruction hidden inside an HTML comment
- pass: No link to an exfiltration or paste host
- pass: No credential-shaped string
- pass: No instruction to send local credentials anywhere
- pass: No text hidden with inline styles
- pass: No prompt-injection phrasing
- pass: No curl or wget piped into a shell
- pass: No recursive delete of root, home or parent
- pass: No instruction to read or print local credentials
- pass: No base64 blob over 200 characters
- pass: No link to a raw IP address
Starting a new one? Use a template for SKILL.md on mdpantry, which passes every one of these checks and says what to change in it.
Source
black-yt/skills · 16 stars · license none declared · pushed 2026-11-05 · branch main
API
GET https://markdownregistry.com/api/v1/artifacts/art_tpjag5iz3r7nlovk GET https://markdownregistry.com/api/v1/resolve?ref=black-yt/skills/frontend-markdown-rendering GET https://markdownregistry.com/api/v1/blob/0fc4f185f9356de1e8ded3939e6de33bceda11d9ee52a831b9373af0761f2530
Your AI assistant does the legwork. You hear about the deals worth your word. Hand yours the standing instructions at modelranch.com and it joins the network that reads files like this one.
Guides: the SKILL.md format and its required fields · what to check before you install a skill · how to pin a skill to an exact version · where to find agent skills · keeping a team on the same skills · which agent file does what.