Repository navigation
Mark Word content that does not convert where it stood - #73
Merged
Merged
Conversation
Mammoth drops equations, charts, SmartArt and bare embedded objects, often without a warning, so readers and the assistant took the converted text for the whole document. Before conversion, those elements are now replaced in document.xml with an italic marker such as (Equation not converted). Comments are kept and listed at the end. Documents with none of these pass through unchanged.
This was referenced Oct 2, 2026
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #45.
Word documents reach both the reader and the assistant through the same Mammoth → Markdown conversion, which silently drops some content. A probe with hand-built documents (Mammoth 1.12.3) showed:
Mammoth's warnings both over- and under-report, so they cannot drive a notice.
Change
core/docx-unconverted.ts: before Mammoth runs,word/document.xmlis scanned by namespace for a fixed list (m:oMathPara/m:oMath, drawings holdingc:chartordgm:relIds,w:objectwithoutv:imagedata). Each is replaced in place with an italic run such as (Equation not converted), so the reader and the assistant both see the gap where it is. Content undermc:Choiceis skipped, because Mammoth shows themc:Fallback. A document with none of these, or input that is not a zip package, goes to Mammoth untouched.core/docx.ts: comments are kept via Mammoth'scomment-reference => supand listed at the end; their anchors are unwrapped, since Turndown drops the ids they point to.\\[…\\]) render as display math in the reader.jszipbecomes a direct dependency. It was already in the bundle through Mammoth, at the same version.Verification
pnpm checkpasses. The new tests build real .docx packages and run real Mammoth.(1)with its text at the end;Field notes.docxrenders as before.