docs(changelog): 记录 htmlUtils 工具库新增
- 添加 htmlUtils.js 工具函数库详细记录 - 记录 200+ HTML 实体解码支持 - 记录新增的 4 个工具函数 - 记录 RichTextRenderer 重构内容 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Showing
1 changed file
with
20 additions
and
0 deletions
| ... | @@ -58,6 +58,26 @@ | ... | @@ -58,6 +58,26 @@ |
| 58 | **相关提交**: | 58 | **相关提交**: |
| 59 | - `ac207cf` - docs(changelog): 移除错误添加的项目功能变更记录 | 59 | - `ac207cf` - docs(changelog): 移除错误添加的项目功能变更记录 |
| 60 | 60 | ||
| 61 | +### 13:35:17 - refactor(utils): 新增 htmlUtils 工具库并重构 RichTextRenderer | ||
| 62 | + | ||
| 63 | +**影响文件**: | ||
| 64 | +- `src/utils/htmlUtils.js` - 新增 HTML 工具函数库 | ||
| 65 | +- `src/components/RichTextRenderer.vue` - 使用工具库,移除内联实现 | ||
| 66 | + | ||
| 67 | +**变更摘要**: | ||
| 68 | +- 新增 htmlUtils.js 工具函数库,包含 200+ HTML 实体解码支持 | ||
| 69 | +- 支持 DOM API(H5)和手动映射(小程序)双模式自适应 | ||
| 70 | +- 新增工具函数: | ||
| 71 | + - `decodeHtmlEntities()` - HTML 实体解码(支持基本符号、货币、数学符号、希腊字母等) | ||
| 72 | + - `encodeHtmlEntities()` - HTML 实体编码(XSS 防护) | ||
| 73 | + - `stripHtmlTags()` - 移除 HTML 标签 | ||
| 74 | + - `truncateHtml()` - 截取 HTML 并保留标签完整性 | ||
| 75 | +- RichTextRenderer 组件改用工具库,移除内联实现(减少 53 行代码) | ||
| 76 | +- 清理所有测试 console.log(保留 error 日志) | ||
| 77 | + | ||
| 78 | +**相关提交**: | ||
| 79 | +- `fb33196` - refactor(utils): 新增 htmlUtils 工具库并重构 RichTextRenderer | ||
| 80 | + | ||
| 61 | --- | 81 | --- |
| 62 | 82 | ||
| 63 | ## 2026-02-27 | 83 | ## 2026-02-27 | ... | ... |
-
Please register or login to post a comment