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