dompurifycmshtml
安装方式
先用 Prompt 核对来源与依赖。也可下载安装包。
用 AI 助手安装
复制提示词,让助手先核对固定版本和依赖。
查看 Prompt收起 Prompt
先检查当前 Agent 是否已安装 SkillPI Skill Finder。如果尚未安装,请按官方仓库的说明安装并启用:https://github.com/Findskills/skillpi。然后使用 Skill Finder 打开此 SkillPI 详情页并定位 "dompurifycmshtml":https://skillpi.com/zh/skills/deepskill-f2c6d4b50f75d30c103a5d1b3cd9a363e13f6fae16fb5bd6b2284ff23fcc2071。安装前核对上游来源和版本:https://skillhub.cn/skills/user_3c6cb52e/sanitize-untrusted-html-fragments-before-rendering-previews-comments-or-cms-content-dompurify-skillhub。来源不一致时停止并说明差异。核对通过后,用 Skill Finder 安装目标 Skill,并报告安装路径和来源版本。
来源与配置
skillhub.cn
配置方式待核实
请查看原始来源中的适用工具、依赖和权限要求。
安装实测待补充
dompurifyCMSHTML:当代理必须接受来自用户、富文本编辑器、导入或模型输出的 HTML 但不能安全直接渲染时使用的清理技能。在内容显示预览、保存到 CMS 字段或嵌入下游页面前,使用 DOMPurify 清除危险标签和不安全属性。
介绍来源: third_party · user_3c6cb52e · 1.0.0 参考来源
SkillPi 解读
- 能完成的任务
- 当代理必须接受来自用户、富文本编辑器、导入或模型输出的HTML,但无法安全地直接渲染时,请使用DOMPurify。该技能在内容显示预览、存储到CMS字段或嵌入下游页面之前,会清除危险标记和不安全属性。
- 软件、账号及付费要求
- 翻译待完成,请参阅来源文档。
- 实测状态
- 未测试
文件浏览
Frontmatter
name: "在使用DOMPurify渲染预览、评论或CMS内容之前,先清理不受信任的HTML片段。"
slug: "sanitize-untrusted-html-fragments-before-rendering-previews-comments-or-cms-content-dompurify"
version: "1.0.0"
displayName: "在使用DOMPurify渲染预览、评论或CMS内容之前,先清理不受信任的HTML片段。"
summary: "当代理必须接受来自用户、富文本编辑器、导入或模型输出的HTML,但无法安全地直接渲染时,请使用DOMPurify。该技能在内容显示预览、存储到CMS字段或嵌入下游页面之前,会清除危险标记和不安全属性。"
license: "MIT"
description: "当代理必须接受来自用户、富文本编辑器、导入或模型输出的HTML,但无法安全地直接渲染时,请使用DOMPurify。该技能在内容显示预览、存储到CMS字段或嵌入下游页面之前,会清除危险标记和不安全属性。"
github_stars: 16854
verification: "security_reviewed"
source: "https://github.com/1991513ccie-png/skills"
author: "1991513ccie-png"
publisher_type: "individual"
category: "Security & Verification"
framework: "Custom Agents"
tool_ecosystem:
github_repo: "1991513ccie-png/skills"
github_stars: 16854
npm_package: "dompurify"
npm_weekly_downloads: 165206079在使用DOMPurify渲染预览、评论或CMS内容之前,先清理不受信任的HTML片段。
Use DOMPurify when an agent must accept HTML from users, rich text editors, imports, or model output but cannot safely render it as-is. The skill strips dangerous markup and unsafe attributes before the content is shown in previews, stored in CMS fields, or embedded in downstream pages.
Prerequisites
Node.js or a JavaScript runtime with DOM support
Installation
Use the upstream install or setup path that matches your environment:
- npm install dompurify
- npm install jsdom
- npm install isomorphic-dompurify
Requirements and caveats from upstream:
- Our automated tests cover 9 browser/OS combinations (Chromium, Firefox, and WebKit across Ubuntu, macOS, and Windows) on every push, plus Node.js v20, v22, v24, v25 and v26 running DOMPurify on [jsdom](https://github....
- DOMPurify technically also works server-side with Node.js. Our support strives to follow the Node.js release cycle.
- Running DOMPurify on the server requires a DOM to be present, which is probably no surprise. Usually, jsdom is the tool of choice and we strongly recommend to use the latest versi...
Basic usage or getting-started notes:
-
If you have problems making it work in your specific setup, consider looking at the amazing isomorphic-dompurify project which solves lots of problems people might r...
-
Note that in order to create a policy in trustedTypes using DOMPurify, RETURN_TRUSTED_TYPE: false is required, as createHTML expects a normal string, not TrustedHTML. The example below shows this.
-
// be careful please, this mode is not recommended for production usage.
-
Extracted from upstream docs: https://raw.githubusercontent.com/cure53/DOMPurify/HEAD/README.md
Documentation
当前收录版本
1.0.0
安全与评测信息
质量评测
满分100 · 来自 SkillPi LAB 实验室的评测报告。
亮点
- 解决 HTML 输入场景下的 XSS 安全风险,具有明确的安全刚需价值
- 覆盖用户输入、富文本编辑器、模型输出等多种典型不安全 HTML 来源
亮点
- 触发场景描述清晰完整,边界明确,覆盖多种变体
待提升项
-
缺少独立 When to Use 章节和端到端代码示例 原报告严重程度:轻微
文档结构基本完整,但未提供具体的使用示例代码,When to Use 场景描述可更突出
改进建议:建议补充一个完整的代码使用示例,并将 When to Use 场景独立成节以便用户快速理解
亮点
- frontmatter 完整,包含必要的元数据信息
- 文档结构清晰,分章节合理
亮点
- 工具来源明确,提供了多种安装路径和依赖说明
- 提及了 server-side 使用需要 jsdom 等关键依赖和异常处理
取前四项原始分值的算术平均,四舍五入取整。可通过收录报告核对各项评分与说明,运行记录需单独查证。
正文静态检测
100 / 100 · skillpi-20261123-no-r3-v1
正文未命中当前规则。
分数仅反映正文中的规则命中,供使用前参考。附件与运行行为不在此评分范围内。
权限与使用前检查
根据当前主文档自动整理,命中内容可能是示例或防护说明;不是实际权限声明,也未覆盖附件、外部依赖或运行行为。
-
安装或获取外部依赖
使用官方来源并锁定版本,在隔离环境检查安装脚本。当前文档检查不覆盖后续下载的代码。
主文档提及 · 第 34, 35, 36 行
文档引用的域名或地址
这些地址可能用于文档链接或示例,不是已批准的联网清单。使用前核对实际目的地及发送的数据。
- github....
- github.com
- nodejs.org
- raw.githubusercontent.com
安全评级与访问范围
safe · 静态证据核验,不代表运行安全保证。
翻译待完成,请参阅来源文档。
使用前请由宿主核对并授权实际文件读写、外部服务和联网目的地;本站的核验不会授予任何运行权限。
用户讨论
还没有已核实的点评。