1
0
Files
PPTX/openspec/changes/archive/2026-03-02-add-text-auto-wrap/tasks.md
lanyuanxiaoyao b2132dc06b 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
2026-03-02 15:23:14 +08:00

23 lines
789 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 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说明文本框默认启用自动换行