I'm building a Markdown to Delta tool, and for code-blocks, empty lines have to be preserved. I noticed quill.getContents() returns a delta with '' empty insert to preserve empty lines in code-blocks. However, running delta.insert('') doesn't append a new Op to that delta. However, a space character works ok.
example:
const delta = new Delta()
delta.insert('text')
delta.insert('') // delta.insert(' ') works though
delta.insert('another text')
console.log(delta.ops.length) // 2 but expected 3
I'm building a Markdown to Delta tool, and for code-blocks, empty lines have to be preserved. I noticed
quill.getContents()
returns a delta with''
empty insert to preserve empty lines in code-blocks. However, runningdelta.insert('')
doesn't append a new Op to that delta. However, a space character works ok.example: