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
Reproduced on the current PyPI release (markitdown==0.1.7, Python 3.12.13):
HTML <u>underlined</u> → underlined
Minimal DOCX <w:u w:val="single"/> → underlined
So #35 still affects both HTML and DOCX in 0.1.7. The active PRs above may address DOCX, but regression coverage should include direct HTML as well. A compatible output is inline HTML (<u>underlined</u>) because CommonMark permits raw HTML.
I independently tested this alongside other inline-formatting cases; inconsistent strikethrough preservation is tracked separately in #2340.
I reproduced and reviewed this on current main. An opt-in approach is the safest compatibility boundary: preserve the existing default output, while allowing HTML and DOCX callers to request literal <u>...</u> output.
PR #1672 already implements that design for both HTML and DOCX, so I am not opening another duplicate PR. I independently exercised the important edge cases locally: surrounding whitespace, nested Markdown, empty underline tags, caller-provided Mammoth style-map precedence, constructor configuration, and per-conversion override. The focused selection passed (5 tests; the broader relevant selection passed 14 with 3 optional/environment skips), together with Black and git diff --check.
The main review point I would retain for whichever underline PR is merged is that an injected Mammoth u => u rule must not override a caller's own u => ... style mapping.
Activity
gagb commentedon Dec 15, 2024
Can you please provide more context for repro?
yuyangchee98 commentedon Dec 19, 2024
If the word document contains underlined text, this styling does not show up in the printed result.
dutsuwak commentedon Jun 11, 2025
Is there any fix for this?
fix: preserve underline formatting in DOCX to Markdown conversion
cagdasyurekli commentedon Aug 25, 2026
Reproduced on the current PyPI release (
markitdown==0.1.7, Python 3.12.13):<u>underlined</u>→underlined<w:u w:val="single"/>→underlinedSo #35 still affects both HTML and DOCX in 0.1.7. The active PRs above may address DOCX, but regression coverage should include direct HTML as well. A compatible output is inline HTML (
<u>underlined</u>) because CommonMark permits raw HTML.I independently tested this alongside other inline-formatting cases; inconsistent strikethrough preservation is tracked separately in #2340.
cagdasyurekli commentedon Aug 26, 2026
I reproduced and reviewed this on current
main. An opt-in approach is the safest compatibility boundary: preserve the existing default output, while allowing HTML and DOCX callers to request literal<u>...</u>output.PR #1672 already implements that design for both HTML and DOCX, so I am not opening another duplicate PR. I independently exercised the important edge cases locally: surrounding whitespace, nested Markdown, empty underline tags, caller-provided Mammoth style-map precedence, constructor configuration, and per-conversion override. The focused selection passed (5 tests; the broader relevant selection passed 14 with 3 optional/environment skips), together with Black and
git diff --check.The main review point I would retain for whichever underline PR is merged is that an injected Mammoth
u => urule must not override a caller's ownu => ...style mapping.