xcv20261768

Use marked to convert Markdown to HTML for preview rendering, applicable to marked/Markdown-to-HTML or daily report preview scenarios. Pay attention to XSS sanitization when in use.

Installation

Review the source and dependencies with a prompt. A package is available to download.

Install with an AI assistant

Copy the prompt so your assistant can review the pinned revision and dependencies first.

View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "xcv20261768" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-22fe3f768eedd0fbebd8bdeae861618bea30faee0286d26b122efa5239d1dd37. Verify the upstream source and version against https://skillhub.cn/skills/user_f1b049da/xcv20261768 before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.

Source and setup

skillhub.cn

Setup guidance pending

See the original source for supported tools, dependencies, and permissions.

Installation test pending

Use marked to convert Markdown to HTML for preview rendering, applicable to marked/Markdown-to-HTML or daily report preview scenarios. Pay attention to XSS sanitization when in use.

0 Downloads

Introduction source: third_party · user_f1b049da · 1.0.0 Reference

SkillPi interpretation

Tasks
Translation pending; see source documentation.
Testing
Not tested

Browse files

Browse files at the source ↗

Original SKILL.md

Open original ↗
Frontmatter
name: xcv20261768
slug: xcv20261768
displayName: Marked Markdown
version: 1.0.0
summary: 用 marked 把 Markdown 转 HTML,适合 AI 日报与存档预览渲染。
license: MIT
description: 用 marked 将 Markdown 转为 HTML 做预览渲染。当用户要 Marked、Markdown 转 HTML、日报预览时使用。注意 XSS 消毒。

Marked Markdown(marked)

灵感:能力工具箱 marked(pkg: marked)。

小四原创:MD → HTML 预览;不可信内容必须消毒(如 DOMPurify),禁止 v-html 裸渲用户输入。

何时使用

  • AI 日报 / 跟进纪要 Markdown 预览
  • 帮助文档、存档说明渲染
  • 轻量预览,不上完整富文本编辑器

硬约束

  1. 使用 marked;配置 breaks 等按产品需要。
  2. XSS:用户/模型产出 HTML 经消毒再插入 DOM。
  3. 大文档可截断预览并提示「完整内容请下载」。
  4. 实现要点注释标 小四原创。
  5. 与「一键同步文章」区分:本包只管渲染,不做网页抽取。

推荐实现

import { marked } from 'marked'
// 可选:import DOMPurify from 'dompurify'

// 小四原创:安全渲染
export function mdToSafeHtml(md: string): string {
  const raw = marked.parse(String(md || ''), { async: false }) as string
  // 生产环境务必消毒,例如:
  // return DOMPurify.sanitize(raw)
  return raw
}
<!-- 小四原创:示意;html 须已消毒 -->
<div class="md-body" v-html="safeHtml" />

Agent 步骤

  1. 接入 marked;封装 mdToSafeHtml。
  2. 接上消毒库或等价白名单。
  3. 样式:标题/列表/代码块基础 CSS。
  4. 自测:标题列表代码;含 <script> 的恶意 MD 被剥除。

不要做

  • 对不可信 Markdown 关闭消毒。
  • 把完整 Word/PDF 管线塞进本轻量 Skill。

附加

Current listing version

1.0.0

Verify the source revision ↗

Quality assessment

Out of 100 · Assessment report from SkillPi LAB.

Scenario Value75/100

Highlights

  • 适用于 AI 日报、文档预览等高频场景,具有明确实用价值
Trigger Precision85/100

Highlights

  • 触发词精准,覆盖 'Marked、Markdown 转 HTML、日报预览' 等多种变体
Structure and Standards78/100

Areas to improve

  • 缺少端到端用户示例 Reported severity: Minor

    文档提供了代码实现示例,但缺少完整的用户输入输出样例

    Recommendation: 补充一个完整的 Markdown 输入和对应 HTML 输出的示例,帮助用户快速理解效果

Highlights

  • 文档结构完整,包含使用场景、硬约束、实现要点等必要章节
Execution Reliability72/100

Areas to improve

  • 错误处理机制不完善 Reported severity: Minor

    marked 解析失败时缺乏 fallback 处理机制

    Recommendation: 建议在 mdToSafeHtml 函数中添加 try-catch,解析失败时返回错误提示或空字符串

Highlights

  • 明确强调 XSS 消毒的重要性,并提供了 DOMPurify 的使用建议
Evidence Verifiability (mean of the first four)78/100

The arithmetic mean of the first four original scores, rounded to a whole number.

Static text checks

100 / 100 · skillpi-20261123-no-r3-v1

No current rules matched the text.

This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.

Permissions and checks before use

Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.

These common operations were not identified in the main document. This does not mean no permissions or risks exist.

These notices grant no permissions. Your host tool must still confirm file changes, secrets, external transfers or costs as needed.

Security rating and access scope

safe · Static evidence review; not a runtime safety guarantee.

Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.