medium-editor-autolist icon indicating copy to clipboard operation
medium-editor-autolist copied to clipboard

Blank space after first element

Open psypersky opened this issue 9 years ago • 3 comments

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?

psypersky avatar Apr 12 '16 04:04 psypersky

I think it should be done with the slice function's proper parameter. Check by changing the number inside it

varun-raj avatar Apr 14 '16 10:04 varun-raj

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);
}

kilgarenone avatar Aug 13 '17 07:08 kilgarenone

It should be solved, as a side effect, by #8.

zuck avatar Sep 05 '17 19:09 zuck