PPTX chart labels with pipes or line breaks produce malformed Markdown tables
维护者通常 1 天内回复
评估
调研方向
运行提供的 PPTX 图表复现流程,以检查格式错误的 Markdown 表格。在 PPTX 图表表序列化路径中,将单元格格式与 CSV 转换路径进行比较;后者已经会转义管道符并合并换行。完成意味着系列名称和类别标签仍保留在预期的单元格中,管道符转义为 \|,换行被合并,并且生成的 Markdown 呈现为表格。
由索引模型根据 Issue 内容生成。
描述
What happened
When a PowerPoint chart has a pipe in a series name or a category label, the converter writes it as a Markdown column separator. A line break inside the label also splits the row. The resulting header can have a different number of cells from the delimiter row, so a Markdown renderer may show plain text instead of a table.
Reproduction
Install markitdown[pptx] and run this example.
from io import BytesIO
from markitdown import MarkItDown, StreamInfo
from pptx import Presentation
from pptx.chart.data import CategoryChartData
from pptx.enum.chart import XL_CHART_TYPE
from pptx.util import Inches
deck = Presentation()
slide = deck.slides.add_slide(deck.slide_layouts[6])
data = CategoryChartData()
data.categories = ["North | West\nRetail"]
data.add_series("Revenue | Forecast", [10])
slide.shapes.add_chart(XL_CHART_TYPE.COLUMN_CLUSTERED, 0, 0, Inches(6), Inches(4), data)
stream = BytesIO()
deck.save(stream)
stream.seek(0)
print(MarkItDown().convert_stream(stream, stream_info=StreamInfo(extension=".pptx")).markdown)
Actual chart table
| Category | Revenue | Forecast |
|---|---|
| North | West
Retail | 10.0 |
Expected chart table
| Category | Revenue \| Forecast |
|---|---|
| North \| West Retail | 10.0 |
CSV conversion already escapes pipes and collapses line breaks in Markdown table cells. Applying that same formatting to chart cells would keep labels and values in their intended columns.
Reproduced on main at ed178952a6672abdfd35b5f9e76a80b6cefc086e (MarkItDown 0.1.9), with Python 3.12.10 and python-pptx 1.0.2 on macOS.
OpenAI Codex assisted with reproducing and drafting this report.
- 主要语言
- Python
- 星标
- 198k
- 派生
- 15k
- 平均合并
- 2 小时 16 分钟
- 30 天内合并 PR
- 9
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 提供 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 没有贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
microsoft/markitdown 的其他 Issue
-
IpynbConverter uses a comment inside a Markdown code fence as the notebook title可能已有人在做 @Primaverah 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 77/100
microsoft/markitdown#2964 · 1 条评论 ·
维护者通常 1 天内回复
-
PPTX image alt text ending in a backslash breaks the Markdown image可能已有人在做 @dongyikuan919 于 3 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
microsoft/markitdown#2943 ·
维护者通常 1 天内回复
-
DOCX: math pre-processing re-parses every document.xml even without equations (32 s -> 17.5 s on a 12.5 MB document)可能已有人在做 @houyunsun 于 26 天前认领。 未关闭
难度 1/5 1 小时以内 新手友好度 89/100
microsoft/markitdown#2834 ·
维护者通常 1 天内回复
-
URL fetch sends default python-requests User-Agent, Wikipedia returns 403可能已有人在做 @sushan5140 于 31 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 82/100
microsoft/markitdown#2820 ·
维护者通常 1 天内回复
-
Valid Atom feeds with zero entries are rejected as an unknown feed type可能已有人在做 @Ayush701-code-zm 于 24 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 78/100
microsoft/markitdown#2781 · 1 条评论 ·
维护者通常 1 天内回复
查看 microsoft/markitdown 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复
-
AIR-Bench Foundation reads the first letter of the word after "answer" as the model's choice可能已有人在做 @beartester34 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 84/100
modelscope/evalscope#2330 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 74/100
-
难度 2/5 1-3 小时 新手友好度 72/100
维护者通常 1 天内回复
-
Distribution plot crashes when a numeric feature is constant in the train or test set可能已有人在做 @adembilge 今天认领。 未关闭bug good first issue
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 10 天内回复