Skip to content

fix(export) html charset 修复html格式导出没带字符集导致重新导入乱码的问题#1775

Merged
coltea merged 1 commit intochaitin:mainfrom
coltea:fix-export-html-charest
Mar 23, 2026
Merged

fix(export) html charset 修复html格式导出没带字符集导致重新导入乱码的问题#1775
coltea merged 1 commit intochaitin:mainfrom
coltea:fix-export-html-charest

Conversation

@coltea
Copy link
Copy Markdown
Collaborator

@coltea coltea commented Mar 23, 2026

PR 标题

fix(export) html charset 修复html格式导出没带字符集导致重新导入乱码的问题

变更类型

请勾选适用的变更类型:

  • Bug 修复 (不兼容变更的修复)
  • 新功能 (不兼容变更的新功能)
  • 功能改进 (不兼容现有功能的改进)
  • 文档更新
  • 依赖更新
  • 重构 (不影响功能的代码修改)
  • 测试用例
  • CI/CD 配置变更
  • 其他 (请描述):

变更内容

详细描述本次 PR 的具体变更内容:

  1. fix(export) html charset 修复html格式导出没带字符集导致重新导入乱码的问题

测试情况

描述本次变更的测试情况:

  • 已本地测试
  • 已添加测试用例
  • 不需要测试 (理由: )

其他说明

任何其他需要说明的事项:

Copilot AI review requested due to automatic review settings March 23, 2026 07:46
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

该 PR 修复了 Admin 端文档编辑器导出 HTML 时未指定字符集,导致导出后再导入出现乱码的问题,通过在导出内容与 MIME type 中显式声明 UTF-8 来提升可移植性与再导入兼容性。

Changes:

  • 导出 HTML 时设置 text/html;charset=utf-8 的 Blob MIME type。
  • 导出 HTML 时为内容补齐完整 HTML 文档结构,并在 <head> 中加入 <meta charset="utf-8" /><title>

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread web/admin/src/pages/document/editor/edit/Wrap.tsx Outdated
Comment thread web/admin/src/pages/document/editor/edit/Wrap.tsx Outdated
@coltea coltea force-pushed the fix-export-html-charest branch from d4d4944 to 77f67eb Compare March 23, 2026 07:58
@coltea coltea requested a review from KuaiYu95 March 23, 2026 07:59
@coltea coltea merged commit 7d64cc4 into chaitin:main Mar 23, 2026
3 checks passed
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.

3 participants