Project

General

Profile

缺陷 #2 » tpc-leg-001-regression.md

Redmine Admin, 09/22/2026 09:11 AM

 

TPC-LEG-001 回归证据

执行日期:2026-09-22

用例目标

历史 HTML 转换为 Markdown 前,应完整移除危险元素及其内容;正常标题、段落、列表与行内格式必须保留。

Node 定向测试

命令:

node --test src/components/MarkdownEditor/legacyHtml.test.mjs src/views/meetings/meetingFormContract.test.mjs src/views/topics/topicDetailContract.test.mjs

结果:17 tests,17 pass,0 fail。

其中 legacyHtml.test.mjs 覆盖:

  • script/style 元素及内容移除;
  • iframe/object/template/noscript/embed 移除;
  • 未闭合危险元素后的内容丢弃;
  • 正常段落、列表与行内格式保留。

浏览器实际源模块输入

在 Ego Browser TaskSpace 14 中打开本地 Vite 应用,并从实际开发服务器动态导入:

/src/components/MarkdownEditor/legacyHtml.mjs?qa=redmine-2-retest

输入:

<h2>正常标题</h2><script>window.QA_LEGACY_XSS=1</script><p>正常段落</p><ul><li>保留列表 A</li><li><strong>保留列表 B</strong></li></ul>

实际输出:

<h2>正常标题</h2><p>正常段落</p><ul><li>保留列表 A</li><li><strong>保留列表 B</strong></li></ul>

断言:

  • scriptTextRemoved=true
  • headingPreserved=true
  • paragraphPreserved=true
  • listPreserved=true

结论:Pass。

(3-3/3)