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 first locate the table extension, its NodeView implementation, and nearby tests/package scripts. Then I’ll reproduce the missing attributes with the existing test setup, update the NodeView API/wiring so configured attributes reach the actual <table>, and run the focused test suite plus relevant type checks.

  3. Assistant

    ripgrep is unavailable, so I’ll use grep/find to inspect the implementation and existing table tests without installing unnecessary tooling.

  4. Assistant

    I found the newly active TableView path. I’ll now inspect its constructor and the extension’s attribute/rendering logic, then compare other NodeViews for the repository’s standard way of applying static HTML attributes (especially handling class/style and non-string values).

  5. Assistant

    The key design issue is that HTMLAttributes are extension options, while node.attrs.style can change over time. Passing options into the default/custom View constructor is the smallest compatible extension, but custom Views currently declare a 3-argument constructor and JavaScript safely ignores a fourth argument. I’ll inspect the schema/render method and attribute utility semantics before choosing whether to apply raw options or merged node/render attributes.

  6. Assistant

    renderHTML merges configured attributes with rendered node attributes and computed width styles. For parity, the NodeView should receive the already merged HTMLAttributes supplied by Tiptap’s NodeView renderer rather than only reading the node’s style; this preserves classes and extension-added attributes. However, the resizable plugin constructs the View itself, so I’ll inspect that API and tests to ensure the fix covers both default and resizable modes without breaking custom View constructors.

  7. Assistant

    The ProseMirror resizing plugin only passes (node, cellMinWidth, view), so merely adding an attributes argument at the normal call site would still fail in resizable mode. I’ll first run a temporary focused Vitest spec to document the regression. Then I’ll add an optional fourth constructor argument (backward-compatible for custom Views), pass merged attributes from Tiptap’s non-resizable renderer, and provide a small configured subclass to the resizing plugin so it can inject the same options despite its fixed three-argument API.

  8. Assistant

    The first test command hit Corepack’s interactive download prompt (which this environment cannot answer), leaving the temporary spec in place. Dependencies are already installed, so I’ll invoke the local Vitest binary directly to complete the reproduction, then remove the temporary test.

  9. Assistant

    The temporary test initially failed during schema construction because table rows reference tableHeader; that is a reproduction setup error rather than the reported bug. I’ll rerun with the complete table schema to establish the expected assertion failure before editing source.

  10. Assistant

    The corrected reproduction now fails exactly as reported (class is null). I’ll implement attribute application on the inner table, preserving the existing node-level style precedence via mergeAttributes. I’ll also update the View constructor type and both creation paths: non-resizable gets the fully merged renderer attributes, while resizable gets a wrapper View that supplies configured attributes through ProseMirror’s fixed constructor contract.

  11. Assistant

    Python is not installed in this environment, so no files were changed. I’ll perform the same targeted edits with the available Node.js runtime and immediately inspect the diff for formatting and type correctness.

  12. Assistant

    The diff now applies all non-null configured attributes to the inner <table> and merges styles rather than replacing configured declarations. I’ll rerun the same temporary test for both resizable: false and resizable: true, including class, data, and style assertions, to verify both NodeView creation mechanisms.

  13. Assistant

    The regression test now passes in both modes, including non-class attributes and configured styles. Next I’ll run the existing extension-table tests and package build/type declaration generation. This should expose any behavior regressions, constructor compatibility issues, or formatting/type errors from the dynamic resizable View subclass.

  14. Assistant

    All 34 existing table tests pass. The build command was invoked from the repository root, but this package’s tsup config uses package-relative entry paths, so it reported Cannot find src/table/index.ts; that is an invocation issue. I’ll rerun from packages/extension-table, then run the repository formatter/checker on the two changed files and inspect generated/untracked changes.

  15. Assistant

    The package build, including declaration generation, passes. No generated dist files are tracked as changes. This repository does not install a prettier binary, so I’ll inspect its declared lint/format tooling and use the appropriate local checker; I’ll also consider simplifying duplicate type imports if the linter enforces import consolidation.

  16. Assistant

    The repository uses oxfmt and oxlint; git diff --check is already clean. I’ll run both tools against the changed files, applying only formatter-generated source changes if needed, then recheck the diff.

  17. Assistant

    Formatting and linting both pass with zero findings. Before submission, I’ll do a final source/diff review and verify there are no temporary tests or build artifacts in the patch. I’ll specifically check that custom three-argument View constructors remain structurally assignable and that null attributes are skipped consistently with DOM serialization.

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