Untitled conversation
- User
[Bug]: extension-table 3.23 TableView NodeView ignores HTMLAttributes (regression from 3.22.4)
Affected Packages
@tiptap/extension-table
Version(s)
3.23.1 (also 3.23.2, 3.23.4)
Bug Description
Summary
In
@tiptap/extension-table3.23.x, configuring the Table extension withHTMLAttributesno longer applies those attributes to the rendered<table>element whenresizable: false(the default). The class/attributes silently disappear from the DOM.This is a regression from 3.22.4, where the same configuration worked correctly.
TableViewexisted byte-identical in 3.22.4, but the Table extension had noaddNodeView()method, so ProseMirror always fell back to the schema'srenderHTML. 3.23 addedaddNodeView()that wires the NodeView in, bypassingrenderHTML.Reproduction
tsimport { Editor } from '@tiptap/core'; import StarterKit from '@tiptap/starter-kit'; import { Table, TableRow, TableHeader, TableCell } from '@tiptap/extension-table'; new Editor({ extensions: [ StarterKit, Table.configure({ HTMLAttributes: { class: 'my-custom-table' } }), TableRow, TableHeader, TableCell ], content: '<table><tbody><tr><td>cell</td></tr></tbody></table>' });Inspect the rendered DOM. The
<table>element has noclass="my-custom-table".Browser Used
Chrome
Code Example URL
https://codesandbox.io/p/devbox/laughing-glade-n4qh4r
Expected Behavior
The
<table>element should render withclass="my-custom-table"(the documented Table.configure HTMLAttributes behavior), regardless of theresizablesetting.A minimal fix would have
TableViewapplythis.options.HTMLAttributesto the inner element in its constructor. - Assistant
I’ll trace the table implementation and the repository’s testing/versioning guidance, then make the smallest regression fix with a focused test and changeset if required.
- Assistant
rgisn’t installed in this workspace, so I’m using targetedfind/grepchecks. The repo guidance confirms this user-visible regression needs a patch changeset and a unit-level regression test. - Assistant
The key compatibility constraint is that custom table views already receive the editor view as their third constructor argument. I’m preserving that API and adding rendered table attributes as an optional fourth argument, while also adapting the resizing plugin path so the configured attributes work in both modes.
- Assistant
The focused regression tests now pass for both non-resizable and resizable tables. I’m checking formatting and the package build next; this also verifies the widened custom
Viewconstructor remains type-compatible. - Assistant
All 36
extension-tableunit tests pass, including the new DOM assertions. The package declaration build and targeted formatting/lint checks also succeed; I’m doing the final repository lint/status pass now.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.