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 version 3.23.x, when resizable: false (default), the HTMLAttributes configured on the Table extension are not applied to the rendered <table> element.
    2. This is because 3.23 introduced addNodeView() which returns a TableView NodeView. TableView builds the DOM manually and never reads this.options.HTMLAttributes.
    3. The fix should have TableView apply this.options.HTMLAttributes to the inner <table> element.

    Let me explore the repository structure first.

  3. DeepSeek Assistant

    Let me explore the packages directory to find extension-table.

  4. DeepSeek Assistant

    Let me look at the extension-table package.

  5. DeepSeek Assistant

    Let me explore the table directory and find the TableView.

  6. DeepSeek Assistant

    Let me look at TableView.ts and table.ts.

  7. DeepSeek Assistant

    Now let me look at the table extension's main file to understand how TableView is used and what options are passed.

  8. DeepSeek Assistant

    Let me also look at the index.ts to see exports:

  9. DeepSeek Assistant

    Let me look at any existing tests for the table extension

  10. DeepSeek Assistant

    Let me check the colgroupUpdate test since it's likely testing the node view.

  11. DeepSeek Assistant

    Now let me create a script to reproduce the

  12. DeepSeek Assistant

    Now let me run it.

  13. DeepSeek Assistant

    The test needs JSDOM. Let me use vitest which is already configured

  14. DeepSeek Assistant

    Let me implement the fix. First, I'll update TableView.ts to accept and apply HTMLAttributes:

  15. DeepSeek Assistant

    Now let me apply the fix. First, update TableView.ts:

  16. DeepSeek Assistant

    I see there's duplicate code from the original constructor. Let me fix that - the old constructor body remained after my edit:

  17. DeepSeek Assistant

    The file is messy. Let me just rewrite the entire file properly:

  18. DeepSeek Assistant

    Now let me update table.ts to pass HTMLAttributes to the View constructor:

  19. DeepSeek Assistant

    Let me find the addNodeView method:

  20. DeepSeek Assistant

    Let me use grep to find it

  21. DeepSeek Assistant

    Let me look at the area around line 523:

  22. DeepSeek Assistant

    I need to fix the parameter order. Currently addNodeView passes (node, cellMinWidth, view) but I changed TableView to accept (node, cellMinWidth, HTMLAttributes). The view would be misinterpreted as HTMLAttributes. Let me update both properly:

  23. DeepSeek Assistant

    The file is corrupted again. Let me rewrite it completely and carefully:

  24. DeepSeek Assistant

    Now update table.ts to pass HTMLAttributes to the View constructor:

  25. DeepSeek Assistant

    Let me verify the changes look correct:

  26. DeepSeek Assistant

    Good, both files look clean. Now let me run the existing table tests to make sure nothing is broken

  27. DeepSeek Assistant

    All tests pass. Now let me verify the fix actually works by creating a quick test:

  28. DeepSeek Assistant

    Now run the tests to verify the fix.

  29. DeepSeek Assistant

    All 3 new tests pass. But I need to remove the test file I created (we're not supposed to add new tests). Let me also run all extension-table tests again to confirm nothing is broken:

  30. DeepSeek Assistant

    Let me run all table tests once more to confirm everything passes

  31. DeepSeek Assistant

    All 44 tests pass. Let me verify the changes with git diff:

  32. DeepSeek Assistant

    The changes look clean and correct. Let me verify the checklist:

    • Reproduce the error: I confirmed the bug by creating a test that showed HTMLAttributes were not applied. The test now passes after the fix.
    • Fix resolves the error: The test with class: 'my-custom-table' now correctly finds the class on the <table> element.
    • Edge cases considered:
      • Empty/undefined HTMLAttributes: handled with the if (HTMLAttributes) guard
      • null/undefined values: filtered out in the forEach loop
      • Custom Views: the 4th argument is optional; custom Views that only accept 3 params will simply ignore it (standard JS)
      • View: null workaround: addNodeView returns null, falling back to renderHTML which already applies HTMLAttributes correctly
      • resizable: true: addNodeView returns null, so the fix doesn't interfere
      • Values are converted to strings via String(value) to handle non-string attribute values
    • Existing tests pass: All 44 tests across 6 test files pass

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