tinymce / tinymce-react

Offical TinyMCE React component
MIT License
959 stars 156 forks source link

Wrap any element inside a custom div in tinymce-react. #385

Closed Absleepy closed 1 year ago

Absleepy commented 2 years ago

Is there any option to wrap an element inside a custom div. For example I want to insert table inside the Editor and then I want to wrap that table inside a Div just so I can apply my styling on that div.

There Should be an option for wrapping an element inside your own custom html element.

For example. If there is tag and I want that tag to be wrapped inside a

tag. Any option?

Thank You!

exalate-issue-sync[bot] commented 2 years ago

Ref: INT-3017

tiny-james commented 1 year ago

Well you can do that.

https://codesandbox.io/s/wrap-table-146gce?file=/src/index.js

The result however is probably not what you want as the editor seems to not want to allow content to be outside of the div so I suggest you find a way to style your tables without wrapping them in a div.

I should point out that this issue is a TinyMCE issue and not something the tinymce-react integration can solve. If you want to report it then open an issue on the tinymce repository not here.