Closed abrookbanks closed 1 month ago
There is something about this not working correctly.
The content from {$CONTENT.content_html|escape:'quotes'}
is appearing below the editor box.
Try this for near lines 131 and 217:
<input type="hidden" name="template[content_html]" id="template_content_html" class="textbox" value='{$TEMPLATE.content_html|escape:'quotes'}'>
The value of the value
property is enclosed in single-quotes.
But now, when using apostrophes in the content and saving, extraneous content comes back below the editor window.
This is what I did on lines 139 and 225:
editor.getSession().on("change", function () { input.value = editor.getSession().getValue().replace(/'/g,"'"); });
but this changes all apostrophes - including tags' single-quoted property values.
Ugh!
We could go back to the base64 decode and encode method.
<input type="hidden" name="template[content_html]" id="template_content_html" class="textbox" value='{base64-encode($TEMPLATE.content_html)}'>
editor.getSession().on("change", function () { input.value = atob(editor.getSession().getValue()); });
Content from input.value instead of feeding in raw value with last commit.
I'm closing this because I'm confident we have a good solution. (Until you tell me otherwise - LOL)
I wanted to use pure the pure atob
function but encountered encoding issues. The function b64EncodeUnicode
seemed to work well.
The page reloads with no content in the code editor.