Closed mitcht closed 7 months ago
I whittled the json down a quite a bit, and noticed there is some possibly invalid JSON being generated as output?
"components":[
{
"name":"Row",
"droppable":".cell",
"resizable":{
"tl":0,
"tc":0,
"tr":0,
"cl":0,
"cr":0,
"bl":0,
"br":0,
"minDim":1
},
"classes":[
"row"
],
"attributes":{
"id":"ik4zj"
}
},
{
"type":"text",
"content":"<p style=\\""text-align":"center;\\""><em>With special appreciation for our <a href=\\""https":" target=\\""_blank\\"">Major Sponsors</a>:</em></p>\\n",
"attributes":{
"id":"in5ko"
}
}
]
Its like the introduction of the escaped double quotes is off slightly. JSON.stringify and JSON.parse don't seem to care about it, but theres something going on.
The root component of the page should be a wrapper
, in your case is a textnode
(eg. this might break a lot of stuff), with an empty tagName
(the reason behind <>
) and for some reason content: "undefined"
(?)
I wouldn't even expect it to load but the editor is making some slight enforcements on the root component but type
and tagName
are extendable so can not be enforced.
Can't really help here, I can only suggest updating the JSON manually or via script. This doesn't seem to be a behavior of any previous version, so might also be related to some custom code.
This is what was coming out of Grapes 0.18.4, therefor it was generated by grapes. I would expect if content was "undefined", grapes would either strip it or ignore it. For now i'm just stripping the <> out on my end, but I thought I'd just share it with you.
GrapesJS version
What browser are you using?
Chrome Version 121.0.6167.185 (Official Build) (64-bit)
Reproducible demo link
https://jsfiddle.net/ja50kzne/4/
Describe the bug
How to reproduce the bug?
<>
being introducedWhat is the expected behavior? I expect to not see
<>
at the start of the string fromeditor.getHtml()
What is the current behavior? I see
<>
upon using.editor.getHtml()
I want to reiterate that I have not messed with the JSON. If there is something in there, it was generated by a previous version of grapesJS.
If is necessary to execute some code in order to reproduce the bug, paste it here below:
Code of Conduct