Repository navigation
Description
Problem
markUnconvertedContent puts a visible marker where Mammoth would drop Word content silently: equations, charts, diagrams and bare embedded objects each get one (ui-packages/web/src/formats/docx-unconverted.ts:49-83). A drawing whose payload is a text box gets none — drawingLabel (lines 59-63) recognizes only c:chart and dgm:relIds, so the drawing passes to Mammoth unmarked.
Mammoth 1.12.3 then loses it without a word. readDrawingElement in its lib/docx/body-reader.js reads a drawing only for image blips (a:graphic > a:graphicData > pic:pic > pic:blipFill > a:blip); a wps shape holding w:txbxContent has no pic:pic, so the result is empty — no text, and no warning either, which leaves reportDocxMessages (ui-packages/web/src/formats/docx.ts:10-17) with nothing to report. Every other lost part is either marked in place or issued (#209 headers, #191 footnotes); this one is the silent case.
Word's own floating text boxes survive, because Word writes them as mc:AlternateContent and Mammoth reads the VML mc:Fallback — the insideChoice filter exists for exactly that (docx-unconverted.ts:20-24). The loss hits documents whose text boxes are written only in DrawingML — Pages and Google Docs exports, python-docx-generated reports — where the box carries real content: the amount on an invoice, the date on a certificate, a callout's whole sentence.
Proposal
- Add 'Text box' to
drawingLabel: a drawing that containswps:txbxis marked in place, like equations and charts. - The
insideChoicefilter already keeps Word's dual-form boxes out, so a bare DrawingML box is the case that receives the marker.
Goal
After this, a .docx whose text boxes arrive only as DrawingML shows "(Text box not converted)" where each one stood, as charts and equations do today; Word's own dual-form boxes stay unmarked, their text still arriving through the VML fallback.
Verification
grep -q "Text box" ui-packages/web/src/formats/docx-unconverted.ts
pnpm --filter -reader/web test --silent -- src/formats/docx-unconverted.test.ts
pnpm checkRefs
- ui-packages/web/src/formats/docx-unconverted.ts:59-63 —
drawingLabelrecognizes chart and diagram only; a text-box drawing passes unmarked - ui-packages/web/src/formats/docx-unconverted.ts:20-24 — the dual-form note behind
insideChoice - node_modules/.pnpm/mammoth@1.12.3/node_modules/mammoth/lib/docx/body-reader.js —
readDrawingElementdescends only topic:picblips and returns empty, without a warning, for awpsshape - Tell readers which Word content did not convert, instead of logging it to the browser console #45 (closed) — the marker system this extends
- Say what a Word header or footer held — the whole part drops without a trace today, though equations and charts get their '(not converted)' markers, so a letter's date or its CONFIDENTIAL status simply vanishes #209 — the sibling whole-part loss (headers, footers); a text box is the remaining unmarked drawing payload
Activity
bencode commentedon Oct 26, 2026
Independent review — posted by the scheduled issue-reviewer loop, independent of the authoring session. Audited against
main@1d515f9(2026-10-26).Evidence audit: every citation holds, anchor-precise.
formats/docx-unconverted.ts:59–63—drawingLabelrecognizes exactlyc:chart→ 'Chart' anddgm:relIds→ 'Diagram', returning null for anything else; awpstext-box drawing passes to Mammoth unmarked.lib/docx/body-reader.js:586—readDrawingElementdescends onlya:graphic > a:graphicData > pic:pic > pic:blipFill > a:blip; awpsshape withw:txbxContenthas nopic:pic, so the result is empty and no warning is issued, leavingdocx.ts:10–17 reportDocxMessagesnothing to report. The silent-loss mechanics are real.insideChoice(:20–24) and the marker helper (:28–36, "(${label} not converted)") confirmed — the Goal's exact "(Text box not converted)" text comes free through the existing helper.Duplicates: none in open + closed — #209 (headers/footers), #191 (footnotes) and #45 (closed, the marker system) are different parts of the same honesty family.
Sensor + Verification block repaired (logged here per policy): lint ✓; verify ✓ passed on unmodified main — a false pass: the block runs the existing
docx-unconverted.test.tsandpnpm check, both green with "Text box" absent from the module. Prepended the deliverable-shaped anchor:grep -q "Text box" ui-packages/web/src/formats/docx-unconverted.tsRe-linted ✓; verify now ✗ on main for the right reason (fails fast).
Sharpening: the
namespacesmap (:3–10) has nowpsnamespace today — the implementation must add the DrawingML wordprocessingShape URI and matchcontains(drawing, wps, 'txbx'). KeepdrawingLabel's match order Chart → Diagram → Text box so a compound drawing (a chart carrying a callout) is still labeled by its dominant payload, andinsideChoicealready keeps Word's dual-form boxes out, as the Proposal states.Verdict: valid — stays open.