Skip to content
TheChatArchiveThe Chat Archive
xiaomi/mimo-v2.5-pro· unknownHugging 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. Assistant

    I'll start by exploring the repository to understand its structure and locate the relevant files for the issue. The bug is about @tiptap/extension-table where HTMLAttributes is not being applied to the <table> element when resizable: false (default) because TableView doesn't read this.options.HTMLAttributes. The issue is in the addNodeView() method and the TableView constructor.

    Let's first check the current directory and see what we have.

  3. Assistant

    Let me look at the relevant files to understand the issue.

  4. Assistant

    Now let's look at the table extension itself to see the addNodeView method.

  5. Assistant

    Let me check how columnResizing from prosemirror-tables uses the View option:

  6. Assistant

    Let me check the prosemirror-tables types to see what signature View expects.

  7. Assistant

    Let me find the View type definition in prosemirror-tables.

  8. Assistant

    Let me check the TableOptions defaults and the types:

  9. Assistant

    Now let me see the full renderHTML method:

  10. Assistant

    Now let me check what mergeAttributes does and what's available:

  11. Assistant

    Now I have a clear understanding of the issue. Let me check how mergeAttributes works:

  12. Assistant

    Now I have a complete understanding of the issue. Let me plan the fix:

    Root cause: TableView's constructor manually builds DOM elements but never applies this.options.HTMLAttributes to the <table> element. The addNodeView() method creates a TableView without passing HTMLAttributes, and since the NodeView bypasses renderHTML, the HTMLAttributes are lost.

    Fix plan:

    1. Update TableView constructor to accept an optional HTMLAttributes parameter and apply them to the <table> element
    2. Update addNodeView() in table.ts to pass HTMLAttributes when creating the NodeView
    3. Update addProseMirrorPlugins() to wrap the View for the resizable case to also inject HTMLAttributes

    Let me start by modifying TableView:

  13. Assistant

    Now let me check if @tiptap/core is a dependency of extension-table:

  14. Assistant

    Let me look at the package.json.

  15. Assistant

    Now I understand the issue completely. Let me implement the fix:

    1. The TableView constructor doesn't accept or apply HTMLAttributes
    2. The addNodeView() method bypasses renderHTML, so HTMLAttributes are lost
    3. Same issue exists for the resizable case via columnResizing

    I'll fix this by modifying addNodeView() and addProseMirrorPlugins() to apply HTMLAttributes to the table element after NodeView construction.

  16. Assistant

    Let me look at the columnResizing type more closely:

  17. Assistant

    Let me look at the columnResizing type more carefully.

  18. Assistant

    Let me understand the full issue now. I need to look at how the View type is defined and how to properly pass HTMLAttributes:

  19. Assistant

    Let me look at the whole TableOptions definition and the addNodeView method:

  20. Assistant

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

    1. Modify TableView to accept an optional HTMLAttributes parameter and apply them to the <table> element
    2. Modify addNodeView() to pass HTMLAttributes to the View constructor
    3. Modify addProseMirrorPlugins() to wrap the View so that HTMLAttributes are passed when using resizable tables

    The approach: Since the View type is (new (node, cellMinWidth, view) => NodeView), I need to handle passing the 4th parameter. The cleanest way is to apply HTMLAttributes inside the addNodeView() callback after creating the view, and similarly for the columnResizing wrapper.

    Let me implement this:

  21. Assistant

    Now I have a full understanding. The fix needs to:

    1. Modify TableView to accept an optional HTMLAttributes parameter and apply them to the <table> element
    2. Modify addNodeView() to pass HTMLAttributes to the View
    3. Handle the resizable case in addProseMirrorPlugins() where columnResizing creates the View

    The View type expects (node, cellMinWidth, view) but TableView only uses (node, cellMinWidth). I'll modify TableView to accept HTMLAttributes as an optional parameter and apply them in the constructor. Then I'll update both call sites.

    Let me implement the fix:

  22. Assistant

    I need to use the correct format for the edit command. Let me use the edit command with proper syntax.

  23. Assistant

    I see the issue - I removed the lines for this.colgroup and this.contentDOM. Let me fix this.

  24. Assistant

    There's a duplicate block now. Let me fix the file properly by looking at the current state:

  25. Assistant

    I see the duplicate block. Let me fix the file:

  26. Assistant

    Now let me fix the formatting - add a blank line between the constructor and the update method:

  27. Assistant

    Good, now I need to update the addNodeView() method in table.ts to pass HTMLAttributes to the View constructor. I also need to handle the resizable case where columnResizing creates the View. Let me update table.ts:

  28. Assistant

    Wait, I realize there's a problem. The View type passes (node, cellMinWidth, view) as constructor arguments, but TableView only takes (node, cellMinWidth). If I add HTMLAttributes as the3rd parameter, it would receive view instead. Let me revert the TableView change and instead take a different approach.

    The cleanest fix: Apply HTMLAttributes after construction in addNodeView() and in the columnResizing wrapper. Let me revert the TableView change:

  29. Assistant

    Now I need to think about the best approach. The View type takes (node, cellMinWidth, view) - if I add HTMLAttributes as a3rd parameter to TableView, it would receive view instead. So I need a different approach.

    The cleanest fix: Modify addNodeView() and addProseMirrorPlugins() to apply HTMLAttributes after creating the NodeView. This way:

    1. TableView doesn't need to change its constructor signature
    2. Both the non-resizable case (via addNodeView()) and the resizable case (via columnResizing plugin) are fixed

    Let me implement this in table.ts:

  30. Assistant

    Now I need to:

    1. Create the applyHTMLAttributesToTable helper function
    2. Update addProseMirrorPlugins() to wrap the View for the resizable case
    3. Make sure everything is properly imported

    Let me update addProseMirrorPlugins() first:

  31. Assistant

    Now I need to add the applyHTMLAttributesToTable helper function. Let me first check what's imported at the top of the file:

  32. Assistant

    Good, mergeAttributes is already imported. Now I need to add the applyHTMLAttributesToTable helper function. Let me also check if we need the EditorView type:

  33. Assistant

    Now I need to add the applyHTMLAttributesToTable helper function. Let me find a good place to add it:

  34. Assistant

    Let me add the applyHTMLAttributesToTable helper function after the imports and before the MarkdownTableToken type:

  35. Assistant

    The file has some corruption - there are duplicate imports and the function was inserted in the wrong place. Let me restore the file and start fresh:

  36. Assistant

    Let me take a better approach. Let me first create a helper function, then modify the two methods separately:

  37. Assistant

    Let me first look at the exact lines for addProseMirrorPlugins and addNodeView:

  38. Assistant

    Now I have a clear picture. Let me think about the best approach. I need to:

    1. Add a helper function applyHTMLAttributesToTable that applies HTMLAttributes to a TableView's table element
    2. Modify addNodeView() to call this helper after creating the node view
    3. Modify addProseMirrorPlugins() to wrap the View for the resizable case

    Let me implement this step by step. First, add the helper function right after the imports, before the MarkdownTableToken type:

  39. Assistant

    I see the MarkdownTableToken type is missing its body. Let me fix that:

  40. Assistant

    The MarkdownTableToken type is broken. Let me fix it:

  41. Assistant

    Good. Now let me update the addNodeView() and addProseMirrorPlugins() methods. Let me find them:

  42. Assistant

    Now let me update addNodeView():

  43. Assistant

    Now I need to update addProseMirrorPlugins() to wrap the View for the resizable case:

  44. Assistant

    The file looks good. Let me verify the full file to make sure everything is correct:

  45. Assistant

    Now let me try to build to see if there are any TypeScript errors:

  46. Assistant

    Let me try using pnpm instead:

  47. Assistant

    Let me try to build using pnpm directly:

  48. Assistant

    Let me try a TypeScript check instead:

  49. Assistant

    Let me check the build setup:

  50. Assistant

    Let me check for existing tests and verify the fix looks correct:

  51. Assistant

    Let me check if there are tests related to HTMLAttributes or TableView:

  52. Assistant

    Let me look at one of the existing tests to understand the test setup:

  53. Assistant

    Let me look at the full test to understand how tests work:

  54. Assistant

    Let me run the existing tests to make sure my changes don't break anything:

  55. Assistant

    All tests pass. Now let me create a reproduction script to verify the fix works:

  56. Assistant

    The test needs a DOM environment. Let me write a test file and run it with vitest:

  57. Assistant

    Now let me run the test to see if the fix works:

  58. Assistant

    All tests pass, including the new HTMLAttributes test and the resizable case. Let me also run all existing tests to make sure nothing is broken:

  59. Assistant

    All 38 tests pass (34 existing + 4 new). Let me clean up the test file since the instructions say not to add new tests to the repository:

  60. Assistant

    Let me verify the final state of the modified file:

  61. Assistant

    Good, only one file was modified. Let me see the full diff to review:

  62. Assistant

    The diff looks clean and correct. Let me run the existing tests one final time to confirm everything is still passing:

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