Skip to content

fix(site-components): handle raw percent code blocks - #899

Open
patrick-andstar wants to merge 1 commit into
Tencent:mainfrom
patrick-andstar:codex/code-block-decode
Open

fix(site-components): handle raw percent code blocks#899
patrick-andstar wants to merge 1 commit into
Tencent:mainfrom
patrick-andstar:codex/code-block-decode

Conversation

@patrick-andstar

Copy link
Copy Markdown
Contributor

🤔 这个 PR 的性质是?

  • 日常 bug 修复
  • 新特性提交
  • 文档改进
  • 演示代码改进
  • 组件样式/交互改进
  • CI/CD 改进
  • 重构
  • 代码风格优化
  • 测试用例
  • 分支合并
  • 其他

🔗 相关 Issue

No related issue. Duplicate search keywords: td-code-block, URI malformed.

💡 需求背景和解决方案

decodeURIComponent throws for ordinary raw code containing a percent sign, such as width: 100%;. Slot content now falls back to its raw value when it is not valid URL-encoded text, while preserving existing decoding for valid encoded content.

Added regression coverage for raw percent signs and URL-encoded slot content.

Validation:

  • pnpm --filter @tdesign/site-components exec jest --coverage --runInBand
  • pnpm exec eslint packages/site-components/src/components/td-code-block/index.js packages/site-components/test/td-code-block.test.js
  • pnpm exec prettier --check packages/site-components/src/components/td-code-block/index.js packages/site-components/test/td-code-block.test.js
  • pnpm --filter @tdesign/site-components build

📝 更新日志

  • fix(site-components): handle raw percent signs in code block slots.

  • 本条 PR 不需要纳入 Changelog

☑️ 请求合并前的自查清单

  • 文档已补充或无须补充
  • 代码演示已提供或无须提供
  • TypeScript 定义已补充或无须提供
  • Changelog 已提供或无须提供

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant