medium-editor-autolist
medium-editor-autolist copied to clipboard
Blank space after first element
The space event reaches the editor after the this.base.getSelectedParentElement().textContent = this.base.getSelectedParentElement().textContent.slice(2).trim(); so it adds a blank space on the first element of the list, i tried using a timeout of 0 to change the content of 'this.base.getSelectedParentElement()' to an empty string but that breaks the list, any suggestion to fix this?
I think it should be done with the slice function's proper parameter. Check by changing the number inside it
Not sure this is the proper way but this is how I fixed it:
if (list_start === '1.') {
setTimeout(() => {
this.base.execAction('insertorderedlist');
this.base.getSelectedParentElement().innerHTML = '';
}, 0);
}
It should be solved, as a side effect, by #8.