I want to implement a solution, such that the first line is always a h1-tag. I have the following tried myself:
quill.on(Quill.events.TEXT_CHANGE, function(delta, oldDelta, source) {
let range = quill.getSelection(true);
let d = quill.formatLine(0, 0, 'header', 1);
quill.setSelection(range.index, range.length);
quill.update();
});
It kind of works, but I've the feeling that this isn't a proper solution, because it still is possible to insert images on the first line.
It would be cool if QuillJS had some method to determine the line.
A simple solution might be to separate the header from the editor
<input type="text">
<div id="editor-container"></div>
Closing inactive issue.
has anyone been able to implement this?