Skip to content
TheChatArchiveThe Chat Archive
DeepSeekdeepseek/deepseek-v4-pro· deepseekHugging 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.

    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. DeepSeek Assistant

    Let me understand the issue:

    1. In @tiptap/extension-table 3.23.x, when Table.configure({ HTMLAttributes: { class: 'my-custom-table' } }) is used, the attributes don't appear on the rendered <table> element when resizable: false (default).

    2. The root cause is that 3.23 introduced addNodeView() in the Table extension, which returns a TableView NodeView. The TableView builds the DOM manually in its constructor but never reads this.options.HTMLAttributes. The schema-level renderHTML (which does apply HTMLAttributes) is bypassed when the NodeView is active.

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

    Let me explore the repository structure and find the relevant files.

  3. DeepSeek Assistant

    Let me find the extension-table package specifically.

  4. DeepSeek Assistant

    Let me look at the extension-table package structure.

  5. DeepSeek Assistant

    Now let me examine the key files: TableView.ts and `table.ts

  6. DeepSeek Assistant

    Let me just read the files using cat.

  7. DeepSeek Assistant

    Now let me look at the table.ts file to see the addNodeView method:

  8. DeepSeek Assistant

    Let me also check the types file

  9. DeepSeek Assistant

    Let me look at how mergeAttributes works in the core:

  10. DeepSeek Assistant

    Let me look at mergeAttributes.

  11. DeepSeek Assistant

    Now I have a clear understanding of the issue. Let me also look at the getRenderedAttributes helper:

  12. DeepSeek Assistant

    Now I have a clear understanding of the issue. Let me implement the fix.

    Plan:

    1. Modify TableView.ts constructor to accept HTMLAttributes as a 4th optional parameter and apply them to this.table
    2. Modify table.ts addNodeView to pass this.options.HTMLAttributes to the View constructor

    Let me start with TableView.ts:

  13. DeepSeek Assistant

    Now let me edit TableView.ts to accept and apply HTMLAttributes

  14. DeepSeek Assistant

    Let me use the replace command instead

  15. DeepSeek Assistant

    Now let me replace the constructor. Let me use replace to update the constructor signature and body:

  16. DeepSeek Assistant

    Let me use the correct format with SEARCH and REPLACE

  17. DeepSeek Assistant

    Let me scroll to line 90 and then try the replace.

  18. DeepSeek Assistant

    Now let me use edit to replace lines 90-105

  19. DeepSeek Assistant

    TableView.ts updated. Now let me modify table.ts to pass HTMLAttributes to the View constructor

  20. DeepSeek Assistant

    Let me find the addNodeView method in table.ts

  21. DeepSeek Assistant

    Let me see the full addNodeView method

  22. DeepSeek Assistant

    Let me open table.ts

  23. DeepSeek Assistant

    Now let me edit line 534 to pass HTMLAttributes

  24. DeepSeek Assistant

    Now let me verify the changes look correct

  25. DeepSeek Assistant

    Let me check if there are built dist files that also need updating

  26. DeepSeek Assistant

    Good, no dist files. Now let me run the existing tests for the extension-table package

  27. DeepSeek Assistant

    Let me check how tests are run in this repo

  28. DeepSeek Assistant

    Let me run the existing tests for the extension-table package

  29. DeepSeek Assistant

    All tests pass. Let me also verify the changes are complete and look at the test file for any related tests

  30. DeepSeek Assistant

    Let me verify there are no TypeScript issues by checking the types

  31. DeepSeek Assistant

    Let me check the TypeScript configuration

  32. DeepSeek Assistant

    Let me check the central tsconfig

  33. DeepSeek Assistant

    The TypeScript errors are only from demos, not from our changed files. Let me verify the final diff of our changes

  34. DeepSeek Assistant

    The diff looks correct. Let me run the tests one more time to confirm everything still passes

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