Closed adamwpe closed 1 year ago
@adamwpe - did you ever find a solution to this? I'm also looking to change how GrapesJS converts quotes.
Hey did anyone resolve this ?
Even I face the same issue
Has anyone found any solution?
Depending how you're using the editor, you can modify the response from editor.getHtml
to unescape the single quotes. For instance:
const html = editor.getHtml({ cleanId: true });
const unescapedHtml = html.replace(/'/g, "'");
@artf I think a good solution could be to include configurations for the editor to allow us to choose which of these escape sequences we want to include out of the ones in the escape mixin (or allow us to override this escape
method entirely).
This shouldn't be an issue anymore from this grapesjs release https://github.com/GrapesJS/grapesjs/releases/tag/v0.20.2
Anyway, for anybody who wants to update the escape logic, the proper way would be to update the textnode
component model (eg. the toHTML
/__escapeContent
method)
If you type in a quote mark:
When it gets converted to html, it's no longer a quote mark.
Is there a way to prevent this?
It does not happen if I rap it around with a script tag, but obviously, it won't be rendered.
I see that you can override the commandCustomCode I can override the 'handleSave' command, like so
and the code variable is correct, but not too sure how target.set works since it looks like it is using backbone.js.