You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've implemented a fix for this as a custom parserHtml function. This can be integrated in BrowserParserHtml.ts file if that makes sense.
Actually DOMParser is trimming of the tags as it considers a tr tag invalid as a root tag.
Wrapping the content in a template tag makes it a valid HTML again and no trimming happens. This would probably fix most if not all similar issues:
GrapesJS version
What browser are you using?
Chrome v121
Reproducible demo link
https://jsfiddle.net/L27powtg/30/ (the fix it also there, commented out)
Describe the bug
How to reproduce the bug?
What is the expected behavior?
The result of toHTML should not trim of the tr, td tags.
What is the current behavior?
resulting html string is missing the tr, td tags.
If is necessary to execute some code in order to reproduce the bug, paste it here below:
I've implemented a fix for this as a custom
parserHtml
function. This can be integrated in BrowserParserHtml.ts file if that makes sense.Actually DOMParser is trimming of the tags as it considers a
tr
tag invalid as a root tag.Wrapping the content in a
template
tag makes it a valid HTML again and no trimming happens. This would probably fix most if not all similar issues:Thanks for this great tool by the way!
Code of Conduct
The text was updated successfully, but these errors were encountered: