PPTX chart labels with pipes or line breaks produce malformed Markdown tables

オープン 初心者向け
#2,937 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

@dongyikuan919 がすでに取り組んでいます。

2026年11月29日 から。

  • #2938 @dongyikuan919 による — オープン

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
92/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
markdown, python
領域
tooling

調査の方向性

提供されている 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分
マージ済み PR(30日)
9

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

  • Dockerfile または Docker Compose ファイルあり
  • プルリクエストのテンプレートなし
  • コントリビューションガイドなし

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

microsoft/markitdown のほかの issue

microsoft/markitdown の issue をすべて見る

似ている issue

Python の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。