Skip to content

Underline not preserved #35

Closed

Description

@yuyangchee98

I get that there is no syntax for underline in Markdown, but maybe an optional setting for <u> .... </u> ?

Activity

  1. gagb commented on Dec 15, 2024

    @gagb
    Contributor

    Can you please provide more context for repro?

  2. added
    question
    on Dec 15, 2024
  3. yuyangchee98 commented on Dec 19, 2024

    @yuyangchee98
    Author

    If the word document contains underlined text, this styling does not show up in the printed result. Image

  4. added
    bug
    open for contribution
    and removed
    question
    on Dec 19, 2024
  5. dutsuwak commented on Jun 11, 2025

    @dutsuwak

    Is there any fix for this?

  6. added a commit that references this issue on Apr 10, 2026
    9950059
  7. cagdasyurekli commented on Aug 25, 2026

    @cagdasyurekli
    Contributor

    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.

  8. cagdasyurekli commented on Aug 26, 2026

    @cagdasyurekli
    Contributor

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugopen for contribution

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions