1
0

feat: enable text auto-wrap for text boxes by default

- Set text_frame.word_wrap = True in add_text_element() for PPTX
- Change CSS from white-space: pre-wrap to normal in HTML preview
- Add overflow-wrap: break-word for better word breaking
- Update README.md with auto-wrap documentation
- Update element-rendering and html-rendering specs
- Archive change: 2026-03-02-add-text-auto-wrap
This commit is contained in:
2026-03-02 15:23:14 +08:00
parent cd7988cbd5
commit b2132dc06b
11 changed files with 500 additions and 173 deletions

View File

@@ -0,0 +1,22 @@
# Implementation Tasks
## 1. PPTX 文本框自动换行实现
- [x] 1.1 修改 `add_text_element()` 函数,在创建文本框后设置 `text_frame.word_wrap = True`
- [x] 1.2 确保所有新创建的文本框默认启用自动换行
## 2. HTML 预览自动换行同步
- [x] 2.1 修改 `render_text_element_to_html()` 函数,调整 CSS `white-space` 样式
- [x] 2.2 将 `white-space: pre-wrap` 改为 `white-space: normal` 以启用自动换行
## 3. 测试验证
- [x] 3.1 创建测试 YAML 文件,包含长文本内容
- [x] 3.2 生成 PPTX 文件,验证文字在文本框内正确换行
- [x] 3.3 启动 HTML 预览,验证预览效果与 PPTX 一致
- [x] 3.4 清理测试文件
## 4. 文档更新
- [x] 4.1 更新 README.md说明文本框默认启用自动换行