Skip to content

fix: avoid pre-sanitizing markdown source#12004

Merged
wanghe-fit2cloud merged 1 commit into1Panel-dev:dev-v2from
A-Words:fix/11998-markdown-rendering-overly-defensive
Mar 2, 2026
Merged

fix: avoid pre-sanitizing markdown source#12004
wanghe-fit2cloud merged 1 commit into1Panel-dev:dev-v2from
A-Words:fix/11998-markdown-rendering-overly-defensive

Conversation

@A-Words
Copy link
Contributor

@A-Words A-Words commented Mar 1, 2026

What this PR does / why we need it?

关联 Issue: #11998
目标: 修复 Markdown 代码块中 </> 被过度防御转义的问题。
背景: 组件此前在 Markdown 渲染前先对原始内容做 DOMPurify.sanitize,会影响代码块文本显示。

Summary of your change

将 mkdown-editor 的输入从 v-model="sanitizedReadMe" 改为 :model-value="props.content",不再预处理 Markdown 源文本。
新增 sanitizeHtml 并通过 :sanitize="sanitizeHtml" 交给 MdEditor 在 HTML 阶段进行消毒。

Please indicate you've done the following:

  • Made sure tests are passing and test coverage is added if needed.
  • Made sure commit message follow the rule of Conventional Commits specification.
  • Considered the docs impact and opened a new docs issue or PR with docs changes if needed.
@f2c-ci-robot
Copy link

f2c-ci-robot bot commented Mar 1, 2026

Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@f2c-ci-robot
Copy link

f2c-ci-robot bot commented Mar 1, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign wanghe-fit2cloud for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@A-Words A-Words changed the title fix(mkdown-editor): avoid pre-sanitizing markdown source (#11998) Mar 1, 2026
@lan-yonghui
Copy link
Member

/lgtm

@f2c-ci-robot f2c-ci-robot bot added the lgtm label Mar 2, 2026
@wanghe-fit2cloud wanghe-fit2cloud merged commit 00d95d6 into 1Panel-dev:dev-v2 Mar 2, 2026
0 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment