Open hata6502 opened 4 years ago
It doesn't work:
const prevFakeBackGround = this.fakeBackground; this.fakeBackground = document.createElement('span'); this.fakeBackground.style.backgroundColor = 'red'; const range = selection.getRangeAt(0); this.fakeBackground.append(range.extractContents()); if (prevFakeBackGround) { // TODO: unificate const clonedNodes = Array.from(prevFakeBackGround.childNodes).map((node) => node.cloneNode(true) ); clonedNodes.forEach((node) => prevFakeBackGround?.parentNode?.insertBefore(node, prevFakeBackGround) ); prevFakeBackGround.remove(); } range.insertNode(this.fakeBackground); this.api.selection.expandToTag(this.fakeBackground);
Fake bacground is too complex.
It doesn't work:
Fake bacground is too complex.