[Beta]: The DOCX demo's Import from Word rejects any file with an image, a footnote, a header, a text box or a partial comment, instead of importing the rest with warnings
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 45/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- react, typescript
Direzione di ricerca
Read packages/platejs/src/docx/import/lib/importDocx.ts around the default lossPolicy and applyLossPolicy, then compare the import options in apps/www/src/registry/components/editor/import-toolbar-button.tsx with the export toolbar's policy. The issue leaves open whether rejecting loss is the intended import contract; clarify that behavior before changing it. Done means the documented contract and demo behavior match, and the listed DOCX cases import their body with dropped content reported as warnings if that is the chosen policy.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Testing lane
- Repository:
udecode/plate - Branch:
next - Release channel: Beta
- Exact commit/package version:
NOT_ENOUGH_INFO
Summary
In the DOCX demo on /docs/docx, Import from Word refuses a Word file as soon as it holds an embedded image, a footnote, a header, a text box or a comment without a complete range. The editor does not change, and one error toast names the first loss. Any Word file with a picture is refused, so most real documents cannot be imported. The docs' Format support table describes these parts as omitted with a diagnostic on an import that goes ahead, and the same demo's export already passes lossPolicy: 'allow'.
Reproduction
The demo on /docs/docx has Import and Export buttons in its toolbar. Import opens a menu with Import from Word.
Repro 1: /docs/docx, Chromium
An agent ran this on 2026-10-21 (PT) in the Claude desktop app's built-in Chromium, at natamox's request.
- Open https://beta.platejs.org/docs/docx.
- Click
Import, thenImport from Word. - Pick one of the files below.
| File | Source | Error toast |
|---|---|---|
comments.docx (one point comment) |
mammoth.js test data | Comment 2 has no complete imported range. |
footnotes.docx |
mammoth.js test data | DOCX footnote content is not mapped into the main document. |
text-box.docx |
mammoth.js test data | DOCX text-box content was dropped. |
tiny-picture.docx |
mammoth.js test data | An embedded image was omitted during DOCX import. |
sample-docx (has a header and an image) |
docx4j's sample documents | DOCX header content is not mapped into the main document. |
The mammoth.js files are in test/test-data of https://github.com/mwilliamson/mammoth.js.
For each file the editor keeps its content, and only the error toast shows. Two mammoth.js files did import: tables.docx (a 2×2 table) with no toast, and strict-format.docx (Strict OOXML) with Imported with 1 warning.
natamox retested /docs/docx by hand on 2026-10-23 (PT): Word files with comments, footnotes, text boxes, images or headers were still refused.
Expected
The body of the file imports, and the parts that cannot come in are reported as warnings.
- The Format support table on /docs/docx says: "Embedded images during import" are handled by "Omit the resource and return a
resource-omitteddiagnostic". For "Multiple-section headers and footers, footnotes, and endnotes" it says "Import reports them as dropped content". For "Fields, text boxes, shapes, charts, SmartArt, and embedded objects" it says "Keep reachable plain text when conversion exposes it; report unsupported or omitted content". Each row reads as a diagnostic on an import that succeeds. - The page says that
exportDocx"rejects content loss by default" (section "Content loss"). Neither the "Import a DOCX file" section nor theimportDocxAPI section says the same for import. The API section listslossPolicyamong the import options without its default. - The same demo exports with
lossPolicy: 'allow'(see Caveat). - The agent's notes expect the body to import with the dropped parts listed as warnings, or the demo to choose its own policy.
If rejecting by default is the intended contract of importDocx, this issue narrows to two things: the import docs should say so, and the demo should pick a policy that imports the body and shows what it dropped.
Actual
The import fails. The editor does not change, and one toast shows the first error's message. Nothing tells the user that the rest of the file could have come in.
Environment
- Exact
nextcommit/Beta package version:NOT_ENOUGH_INFO. The page does not show its build. The agent read the source atnext87b29efbfaon the day of the first run. - First run: an agent in the Claude desktop app's built-in Chromium 152.0.7977.167, desktop viewport 1024×768, on 2026-10-21 (PT). A script put each file into the page's file input; the system file dialog was not used.
- natamox's hand retest on 2026-10-23 (PT). The browser is not recorded.
- On 2026-10-23 (PT) an agent on natamox's Xiaomi 14 (Android 16, Chrome 154) exported the demo as Word and imported that file back through the system file picker. That file has no image, footnote, header or text box, and it imported.
- Not replayed on the live Beta after 2026-10-23. The code below reads the same on
nextfc9ebcd16b.
Caveat
From a reading of the code on next fc9ebcd16b, not checked with a debugger:
packages/platejs/src/docx/import/lib/importDocx.ts:2068setslossPolicyto'reject'when the caller passes none.applyLossPolicy(:1711-1726) turns every warning thatisVisibleLoss(:1705-1709) counts as a visible loss into an error under'reject'. That coversresource-omittedandunsupported-contentdiagnostics.- Every image is removed and recorded as
resource-omitted(:1572-1580). Header and footnote parts get the "not mapped into the main document" message (:1681). A comment without a complete range gets:1930. The text box diagnostic is inpackages/platejs/src/docx/internal/docxPackage.ts:154. - The demo calls
importDocx(arrayBuffer, { plugins, retainSource })with nolossPolicy(apps/www/src/registry/components/editor/import-toolbar-button.tsx:255-258), and on failure shows the first error's message (:260-266). Its export passeslossPolicy: 'allow'(apps/www/src/registry/components/editor/export-toolbar-button.tsx:209-214).
Evidence
- No recording. The original run recorded no video of these imports. The toast texts above are copied from the agent's notes.
Related
- #5285: DOCX import drops underline, text color, background color, alignment, sub/superscript and blockquotes without a warning.
- Lingua principale
- TypeScript
- Stelle
- 16.6k
- Fork
- 993
- Merge medio
- 20h 1m
- PR unite (30g)
- 60
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di udecode/plate
-
triaged
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
I maintainer di solito rispondono entro 1 giorno
-
triaged
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
mobile triaged
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
[Beta]: The docs Demo example page starts with an empty editorForse già presa @natamox l’ha presa oggi. Apertatriaged
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
udecode/plate#5308 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
triaged
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di udecode/plate
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
VictoriaMetrics/victorialogs-datasource#747 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 79/100
I maintainer di solito rispondono entro 1 giorno
-
bug from-studio
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
esengine/DeepSeek-Reasonix#14608 ·
I maintainer di solito rispondono entro 1 giorno
-
triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
getarcaneapp/arcane#4590 ·
I maintainer di solito rispondono entro 1 giorno
-
支持对已取消(cancelled)任务生成报告Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
Clouditera/VulnHunter#57 ·