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

@@ -8,7 +8,7 @@ Element rendering系统负责将 YAML 中定义的各类元素(文本、图片
### Requirement: 系统必须支持文本元素渲染
系统 SHALL 将 YAML 中定义的文本元素渲染为 PPTX 文本框。
系统 SHALL 将 YAML 中定义的文本元素渲染为 PPTX 文本框,并默认启用文字自动换行
#### Scenario: 渲染基本文本元素
@@ -30,6 +30,11 @@ Element rendering系统负责将 YAML 中定义的各类元素(文本、图片
- **WHEN** 文本对齐方式为 `left``center``right` 之一
- **THEN** 系统正确应用对应的对齐方式
#### Scenario: 文本框默认启用自动换行
- **WHEN** 系统渲染任何文本元素
- **THEN** 系统设置 `text_frame.word_wrap = True`,文字在文本框边界处自动换行
### Requirement: 系统必须支持图片元素渲染
系统 SHALL 将 YAML 中定义的图片元素渲染为 PPTX 图片对象。