Skip to content
TheChatArchiveThe Chat Archive
gpt-5.6-sol· openaiHugging Face ibragim-bad/swe_rebench_07_2026_trajectories

ISSUE DESCRIPTION [Bug]: extension-table 3.23 TableView NodeView ignores HTMLAttributes…

  1. User

    ISSUE DESCRIPTION

    [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-table 3.23.x, configuring the Table extension with HTMLAttributes no longer applies those attributes to the rendered <table> element when resizable: 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. TableView existed byte-identical in 3.22.4, but the Table extension had no addNodeView() method, so ProseMirror always fell back to the schema's renderHTML. 3.23 added addNodeView() that wires the NodeView in, bypassing renderHTML.

    Reproduction

    import { 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 no class="my-custom-table".

    Browser Used

    Chrome

    Code Example URL

    https://codesandbox.io/p/devbox/laughing-glade-n4qh4r

    Expected Behavior

    The <table> element should render with class="my-custom-table" (the documented Table.configure HTMLAttributes behavior), regardless of the resizable setting.

    A minimal fix would have TableView apply this.options.HTMLAttributes to the inner <table> element in its constructor.

    Additional Context (Optional)

    Root cause

    3.23 introduced addNodeView() on the Table extension (extension-table dist/index.js around line 645):

    addNodeView() {
      const isResizable = this.options.resizable && this.editor.isEditable;
      const View = this.options.View;
      if (isResizable || !View) {
        return null;
      }
      return ({ node, view }) => new View(node, this.options.cellMinWidth, view);
    }
    

    When resizable is false (default) and View is the default TableView, this returns a NodeView. TableView builds the DOM manually:

    constructor(node, cellMinWidth) {
      this.dom = document.createElement("div");
      this.dom.className = "tableWrapper";
      this.table = this.dom.appendChild(document.createElement("table"));
      if (node.attrs.style) {
        this.table.style.cssText = node.attrs.style;
      }
      this.colgroup = this.table.appendChild(document.createElement("colgroup"));
      updateColumns(node, this.colgroup, this.table, cellMinWidth);
      this.contentDOM = this.table.appendChild(document.createElement("tbody"));
    }
    

    TableView never reads this.options.HTMLAttributes. The schema-level renderHTML (which does call mergeAttributes(this.options.HTMLAttributes, HTMLAttributes, ...)) is bypassed whenever the NodeView is active.

    Workaround

    Table.configure({
      HTMLAttributes: { class: 'my-custom-table' },
      View: null
    })
    

    This disables the NodeView and falls back to the schema's renderHTML. Side effect: loses TableView's in-place update(node) column-width sync; a full re-render happens on attribute changes instead. Acceptable for most read-only or non-resizable use cases.

    Related

    #6176 reports a similar symptom on Tiptap 2.11.5 with resizable: true. Different mechanism (no addNodeView in 2.x), same user-facing impact.

    Dependency Updates

    • Yes, I've updated all my dependencies.

    Interface

    No new interfaces are introduced.

    ADDITIONAL ADVICE

    Since you are given a git repository, you can use git commands to simplify your work. For example, if you made a mistake and want to revert your changes, you can use git checkout <file> to restore the file to its original state. You can also reset all changes in the repository using git reset --hard command. Additionally, you can use git stash and git stash pop to temporarily save your changes and restore them later. Finally, you can see the changes that you've made (which will be submitted when you call submit) using git status or git diff commands. However you don't need to use git add or git commit before submitting your changes. In fact, submit only submits currently unstaged changes because it uses git diff to get the changes that need to be submitted.

    CHECKLIST

    Before submitting your solution, please go over the following checklist and make sure you've done everything:

    • If an error was reported in the issue description, I have successfully reproduced it.
    • If an error was reported in the issue description, I have confirmed that my fix resolves the error.
    • I have thought about edge cases and made sure my fix handles them as well.
    • I have run existing tests in the repository that might have been affected by the change I made and confirmed that they pass. I want you to list every bullet from this checklist and write your reasoning for why you think you did it or didn't need to.

    Repository has been uploaded and your shell is currently at the repository root. Time to solve the issue!

    (Current directory: /tiptap, current file: none) bash-$

  2. Assistant

    I’ll inspect the table extension’s source, tests, and package scripts first. Then I’ll reproduce the missing attributes with the closest existing test setup, implement the fix in the established API style, and run the focused tests plus relevant type/build checks.

  3. Assistant

    ripgrep is unavailable, so I’ll use grep/find. I’m locating the NodeView implementation and nearby test conventions, especially DOM rendering tests that can validate configured attributes without adding repository tests.

  4. Assistant

    The configured attributes are currently only merged by renderHTML, while addNodeView constructs TableView without them. I’ll read both implementations and the column-update tests to determine constructor compatibility requirements—particularly because users can supply a custom View.

  5. Assistant

    A key compatibility constraint is that View is public and its third constructor argument is the ProseMirror EditorView. Replacing that argument with attributes would break custom views. I’ll inspect git history and attribute utilities before choosing between a backward-compatible fourth argument and post-construction handling. I’ll also run the existing focused test once as a baseline.

  6. Assistant

    The baseline test command was blocked because Corepack wants interactive confirmation to download the pinned pnpm version. Since dependencies and Vitest are already installed, I’ll invoke the local binary directly. The history confirms the non-resizable NodeView was recently introduced; I’ll inspect that commit and mergeAttributes semantics, then create a temporary (non-repository) reproduction script/test.

  7. Assistant

    The focused baseline passes, isolating the regression to DOM attributes rather than column synchronization. To reproduce the report exactly without modifying tests, I’ll place a temporary Vitest file under /tmp or generate it briefly in the package and remove it afterward; because Vitest’s include rules may require repository placement, I’ll use a temporary file in the existing test directory and ensure it is deleted before submission. The reproduction will check class, generic data attributes, and style precedence.

  8. Assistant

    The temporary reproduction fails exactly as reported (class is null) and has been removed. The fix should mirror ProseMirror DOM serialization semantics rather than blindly stringifying null values. I’ll locate existing Tiptap helpers for applying rendered attributes and inspect how schema attributes (notably style) are defined, so configured styles still combine correctly with column width logic.

  9. Assistant

    There is no table-specific addAttributes; style arrives via extension/global schema attributes and is already handled by TableView. The safest narrow fix is therefore to let the built-in TableView accept configured HTML attributes while preserving the custom View(node, cellMinWidth, view) contract. I’ll use an optional fourth constructor argument passed only by addNodeView, apply non-null attributes as ProseMirror does, and then apply node style afterward so dynamic node styles retain the same precedence as renderHTML. This also avoids assuming a custom NodeView’s DOM structure.

  10. Assistant

    A better match to renderHTML is available: Tiptap’s NodeView renderer props include the node’s already-rendered HTMLAttributes. I’ll verify that callback type and existing usages. If confirmed, addNodeView can merge configured and dynamic attributes exactly as schema rendering does, pass the merged result as an optional fourth argument, and TableView.update may need to synchronize dynamic attributes on node changes rather than only applying them at construction.

  11. Assistant

    The callback does expose HTMLAttributes. I’ll inspect how core refreshes NodeViews: ProseMirror’s update(node) does not re-run the NodeView factory, so the built-in view should retain configured static attributes and reconcile node-derived style itself. Since the reported configuration is static, constructor application is essential; update behavior should at minimum avoid deleting column sizing while preserving style precedence.

  12. Assistant

    Core computes node-derived HTML attributes only when the NodeView is created. For this regression, merging this.options.HTMLAttributes with that callback value is the exact analogue of the first two arguments to renderHTML’s mergeAttributes. I’ll implement:

    • an optional fourth HTMLAttributes parameter on the public View constructor type (backward-compatible for custom views),
    • passing merged attributes from addNodeView,
    • applying all non-null attributes in built-in TableView before column sizing. Node style is already included in the merged callback attributes, so the old direct style assignment can be replaced rather than duplicated.
  13. Assistant

    Python is unavailable, so no changes were made. I’ll apply the same targeted edits using the repository’s edit/replace commands, then inspect the resulting diff before testing.

  14. Assistant

    The import and constructor type changed, but multiline replacements did not match (and the import replacement introduced one extra blank line). I’ll fix the exact line ranges directly and then apply the addNodeView change by its current line numbers.

  15. Assistant

    The direct line edit revealed a one-line offset and left the old constructor declaration in place; I’ll remove that duplicate and restore the conventional blank line between external and local imports. Then I’ll replace the single return line in addNodeView.

  16. Assistant

    The constructor is now clean. The special replace command still declines the exact addNodeView line despite finding it, so I’ll use a direct line-range edit at line 541 and immediately inspect the surrounding code.

  17. Assistant

    Before broadening behavior, I’ll run the exact reproduction and focused suite plus the package build. This will reveal constructor-type compatibility with columnResizing. I’ll also include configured style in the temporary check; generic styles should survive, while width is a special case because column synchronization intentionally manages width/min-width.

  18. Assistant

    The exact regression and generic/style attributes now pass alongside all nine column-update tests. The initial build invocation used the repository root, but the package’s tsup config expects package-relative paths; I’ll rerun it from packages/extension-table. I’ll also run formatting/lint checks on the changed files. If types pass, I’ll assess whether width-style handling needs a narrow follow-up or would improperly alter existing column-sizing semantics.

  19. Assistant

    The package build, declaration generation, formatter, and linter all pass. I spotted one compatibility edge case before finalizing: the resizable plugin still constructs TableView with three arguments, so replacing the old direct node.attrs.style handling would regress node styles in resizable mode. I’ll restore it as a fallback only when the fourth-argument attributes do not already contain style; this preserves old behavior without overriding the correctly merged non-resizable style.

  20. Assistant

    The fallback is in place and formatted. I’ll now run the complete extension-table unit test directory, repeat the exact temporary regression test after the final code, and rerun package build/type generation. Then I’ll review the final diff and repository status for accidental files.

  21. Assistant

    All 34 extension-table tests pass, the final exact reproduction passes, and the package build/declaration generation succeeds. I’ll perform the final diff review now, checking API compatibility, formatting, and ensuring the temporary test/build artifacts are absent or ignored.

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.