Skip to content

[Bug]: renderHtml not working correctly with nested tags #87

Description

@Lampone

PHP Version

8.2

Version

2.0

Bug Description

I am trying to wrap the table output in a div with a "table-wrapper" class. I extended the \Tiptap\Nodes\Table class and changed the renderHtml function:

public function renderHTML($node, $HTMLAttributes = []) { return [ 'div', ['class' => 'table-wrapper'], [ 'content' => [ 'table', HTML::mergeAttributes($this->options['HTMLAttributes'], $HTMLAttributes), [ 'tbody', 0 ], ] ] ]; }

the result in html is got the format of:
table-wrapper
table
tbody
-content-

Expected Behavior

the result in html should be
table-wrapper
table
tbody
-content-

Additional Context (Optional)

there are example of the js version that it should work:
ueberdosis/tiptap#2041 (comment)

Dependency Updates

  • Yes, I've updated all my dependencies.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions