Hi, I'm creating a new node that has a RED.editor
in it set to ace/mode/html
mode.
I copied the code from the core template node but annoyingly, while everything is otherwise working, the resulting saved code keeps removing newlines.
Does anyone know what I've done wrong?
This is where the editor is created:
const stateId = RED.editor.generateViewStateId('node', node, '')
node.editor = RED.editor.createEditor({
id: 'node-input-editor',
mode: 'ace/mode/html',
stateId: stateId,
value: node.html
})
And this is the oneditsave
function:
function onEditSave(node) {
const html = node.editor.getValue()
$('#node-input-html').val(html)
updateTab(html)
node.editor.destroy()
delete node.editor
}
Everything works correctly except for the HTML code being flattened each time.
In case it matters, I'm using Monaco for the editor.