You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Word defines Heading styles 1 through 9, but the DOCX converter (via mammoth's default style map) only maps Heading 1-6. Paragraphs styled Heading 7, 8, or 9 come through as plain <p> text, so their heading structure is silently dropped from the markdown.
Reproduction
importiofromdocximportDocumentfrommarkitdownimportMarkItDown, StreamInfodoc=Document()
forlevelinrange(1, 10):
doc.add_heading(f"H{level}", level=level)
buf=io.BytesIO(); doc.save(buf); buf.seek(0)
print(MarkItDown().convert_stream(buf, stream_info=StreamInfo(extension=".docx")).markdown)
# H1..H6 render as #..###### but H7, H8, H9 render as plain paragraphs
Deep heading levels are common in legal and technical-spec documents.
Expected behavior
Markdown has no level past 6, so 7-9 clamp to ###### rather than losing the heading entirely.
Environment
markitdown main (945314a), python-docx + mammoth current
Activity