Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

[Beta]: DOCX import drops underline, text color, background color, alignment, sub/superscript and blockquotes without a warning, even from Plate's own export

オープン
#5,285 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
55/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
react, typescript

調査の方向性

Start with packages/platejs/src/docx/import/lib/importDocx.ts around lines 1474–1477 to inspect the Mammoth conversion options, then read apps/www/src/registry/components/editor/import-toolbar-button.tsx around lines 34–46 for warning display. Reproduce the DOCX round trip on /docs/docx and check which formats survive import. Done means supported formats return on import, and unsupported ones are identified in the warnings.

索引モデルが issue の本文から書いたものです。

説明

bug plugin:docx target:beta

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 keeps headings, bold, italic, strikethrough, lists, tables and links. It drops underline, text color, background color, superscript, subscript, paragraph alignment and blockquotes. A file that the same demo has just exported with underline, color, background and centering comes back without any of them, and no warning shows. For a Word file with these formats the only feedback was the toast Imported with 4 warnings., which does not say what was lost.

Reproduction

The demo on /docs/docx has Import and Export buttons in its toolbar. Import opens a menu with Import from Word, and Export one with Export as Word.

Repro 1: round trip on /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.

  1. Open https://beta.platejs.org/docs/docx.
  2. In the demo editor, select a word. With the toolbar, underline it, give it a text color and a background color, and center its paragraph.
  3. Click Export, then Export as Word. The demo saves document.docx.
  4. Click Import, then Import from Word, and pick that document.docx.

The agent checked the exported file: its word/document.xml holds w:u, w:color, w:shd and w:jc for these formats. After step 4 the word has no underline, color or background, and the paragraph is no longer centered. No warning shows.

Repro 2: a Word file with these formats, Chromium

Same agent, browser and date. The agent imported a Chinese report in Word format that it had made for the test. The report has underline, red text, yellow shading, superscript, subscript, a centered paragraph, a right-aligned paragraph and a blockquote.

Headings, bold, italic, strikethrough, lists, the table and links came in. Underline, text color, shading, superscript, subscript, center and right alignment, and the blockquote were all lost. The only toast was Imported with 4 warnings. The file is not attached, since GitHub issues do not take .docx files.

natamox retested /docs/docx by hand on 2026-10-23 (PT): imported files still lost underline, color, shading, alignment and other formats.

Expected

  • The Format support table on /docs/docx says that "Paragraphs, headings, supported marks and properties" "Decode through the installed HTML mappings and export through the configured static renderer". In this demo, underline, text color, background color and alignment are supported: the editor applies them, and Repro 1 shows the demo's export writing them into the Word file.
  • So a file the demo exports should import back with the same formats. Where a format cannot come back, the import should report it, as the docs say it does for other content it omits. This is the expectation in the agent's notes.
  • The warnings toast should say what was dropped, not only how many warnings there were.

Actual

These formats disappear on import. Plate's own export loses them on the way back with no warning. For an outside file, the toast gives only a count.

Environment

  • Exact next commit/Beta package version: NOT_ENOUGH_INFO. The page does not show its build. The agent read the source at next 87b29efbfa on 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 agent read the exported file with a script and LibreOffice in headless mode; it did not open Word.
  • natamox's hand retest on 2026-10-23 (PT). The browser is not recorded.
  • Not replayed on the live Beta after 2026-10-23. The code below reads the same on next fc9ebcd16b.

Caveat

From a reading of the code on next fc9ebcd16b, not checked with a debugger:

  • packages/platejs/src/docx/import/lib/importDocx.ts:1474-1477 converts the file to HTML with mammoth, passing styleMap: ['comment-reference => sup'] and nothing else.
  • Inference: mammoth's default conversion leaves out underline, font color, highlight and alignment, so these formats are gone before Plate's HTML mappings see them, and no diagnostic can record them. This comes from mammoth's documented defaults and was not traced for each format. Why superscript, subscript and blockquotes are lost was not traced.
  • The demo's toast counts the warnings and shows only the count (apps/www/src/registry/components/editor/import-toolbar-button.tsx:34-46).

Evidence

  • No recording. The original run recorded no video of these imports. The toast text and the XML element names are copied from the agent's notes.

Related

  • #5284: The DOCX demo's Import from Word rejects any file with an image, a footnote, a header, a text box or a partial comment.
主要言語
TypeScript
スター
16.6k
フォーク
993
平均マージ
20時間 21分
マージ済み PR(30日)
60

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

udecode/plate のほかの issue

udecode/plate の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。