Repository navigation
Description
Description
MarkItDown preserves some strikethrough representations but silently flattens semantically equivalent variants to plain text. This makes superseded or corrected text indistinguishable from current text in the Markdown output.
The behavior reproduces with the latest PyPI release, markitdown==0.1.7.
Minimal HTML reproduction
from pathlib import Path
from tempfile import TemporaryDirectory
from markitdown import MarkItDown
html = """<!doctype html>
<html><body>
<p>Plain <s>s element</s> after.</p>
<p>Plain <del>del element</del> after.</p>
<p>Plain <strike>strike element</strike> after.</p>
<p>Plain <span style="text-decoration: line-through;">inline CSS line-through</span> after.</p>
<p>Plain <span style="text-decoration-line: line-through;">CSS text-decoration-line</span> after.</p>
</body></html>
"""
with TemporaryDirectory() as tmp:
path = Path(tmp) / "fixture.html"
path.write_text(html, encoding="utf-8")
print(MarkItDown().convert(str(path)).markdown)Actual output
Plain ~~s element~~ after.
Plain ~~del element~~ after.
Plain strike element after.
Plain inline CSS line-through after.
Plain CSS text-decoration-line after.Expected output
All five inputs express strikethrough and should retain that meaning, for example:
Plain ~~s element~~ after.
Plain ~~del element~~ after.
Plain ~~strike element~~ after.
Plain ~~inline CSS line-through~~ after.
Plain ~~CSS text-decoration-line~~ after.At minimum, the obsolete but still encountered <strike> element could be normalized consistently with <s> and <del>. If parsing inline CSS is intentionally out of scope, documenting that limitation would make the loss less surprising.
DOCX observation
A minimal DOCX shows the same inconsistency between OOXML variants:
| OOXML run property | Actual Markdown |
|---|---|
<w:strike/> |
~~single strike~~ |
<w:dstrike/> |
double strike |
Mapping double-strike to ordinary Markdown strikethrough would preserve the important semantic distinction from current text even if Markdown cannot represent the double line exactly.
Impact
The text itself remains present, so conversion appears successful, but consumers can interpret superseded text as current. This is particularly misleading in notes, procedures, and other documents where strikethrough carries meaning.
Environment
- MarkItDown: 0.1.7
- Python: 3.12.13
- OS: macOS 26.6.2, arm64
The same HTML and DOCX outputs were also observed through a MarkItDown MCP installation using markitdown==0.1.5.
Duplicate check
I searched open and closed issues for strikethrough, strike, line-through, double strike, and dstrike and did not find a report matching this behavior.
Activity
NG-PR0JECT commentedon Aug 26, 2026
Solid report — the repro is tight, and this is a good example of the "text survives, semantics die" class of extraction bug: conversion looks successful, but superseded/corrected text becomes indistinguishable from current text downstream. Since MarkItDown is increasingly the ingestion step in RAG/LLM pipelines, that's the worst kind of failure (silent, and it corrupts retrieval meaning).
A few source-level notes that might shorten the fix:
1.
<strike>— one missing method, no upstream fork needed_CustomMarkdownify(converters/_markdownify.py) subclasses the upstreammarkdownify.MarkdownConverter, which definesconvert_del/convert_s→~~…~~but has no converter for the obsolete<strike>element, so it falls through to plain text. Adding a 4-line method to_CustomMarkdownifyfixes it:(Alternatively, normalize in the soup pass before
convert_soup— same result.)2. Inline CSS
line-through— markdownify is tag-driven, so this needs the soup pre-passThe HTML converter already mutates the parsed soup before markdownify (script/style removal, body selection in
_html_converter.py), so a small normalization walk fits the existing structure:The substring check is coarse but safe here:
line-throughonly appears intext-decoration/text-decoration-line(shorthandunderline line-through, longhand,!importantsuffix all match). One caveat — skip elements already insidedel/s/strikeso you don't double-wrap.3. DOCX
w:dstrike— this one is a mammoth mapping, not a markdownify oneDocxConverter routes through
mammoth.convert_to_html(...)and then reuses the same HtmlConverter, so an HTML-layer fix can't reachdstrikeunless mammoth emits a strikethrough tag for it (empirically it doesn't). Two cheap options: pass a default style_map inDocxConverter.convert(mammoth accepts run mappings liker:dstrike => s, merged with any user-supplied map), or normalize it inconverter_utils/docx/pre_process.pyalongside the existing pre-processing. Markdown can't represent double-strike, but~~is the right lossy fallback — it preserves the part that matters (this text is not current).Nice catch on the duplicate check too — genuinely unreported.