markitdown icon indicating copy to clipboard operation
markitdown copied to clipboard

Fix: handle missing w:styleId in DOCX to prevent KeyError

Open Ashhhh010101 opened this issue 3 months ago • 3 comments

Issue

Issue #1413

Some DOCX files may have headings, table cells, or footnotes without a styleId (w:styleId). The original converter crashes with:

KeyError: 'w:styleId'

Fix

Wrapped Mammoth conversion in try/except to catch missing w:styleId.

If missing, fallback safely and continue conversion.

Ashhhh010101 avatar Sep 16 '25 20:09 Ashhhh010101

@MonkeyCode-AI review it

ct-jaryn avatar Sep 17 '25 09:09 ct-jaryn

@microsoft-github-policy-service agree

Ashhhh010101 avatar Sep 17 '25 18:09 Ashhhh010101

⏳ MonkeyCode-AI 正在分析,请稍等片刻...

MonkeyCode-AI avatar Sep 19 '25 09:09 MonkeyCode-AI