striven-editor

Maintained and contributed to an open source WYSIWYG editor as an internship project that made it to production and was adopted by the company I was working at.
git clone https://unitehenry.com/git/striven-editor.git
Log | Files | Refs | README | LICENSE

commit ee42cc884d70bacbef1e76bc578c15230b95d798
parent 91fc53114b8ff7f75a0e04280f2e3a7ded477d24
Author: Henry Unite <unitehenry@gmail.com>
Date:   Fri,  9 Oct 2020 14:43:42 -0400

reuce intitial selection node

Diffstat:
Msrc/striveneditor.js | 4+++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/striveneditor.js b/src/striveneditor.js @@ -289,6 +289,7 @@ export default class StrivenEditor { // Focus back into the body se.body.focus(); } + break; case 'removeFormat': se.executeCommand(command); @@ -2950,7 +2951,8 @@ export default class StrivenEditor { se.setRange(r); const b = document.createElement(el); - const selNode = document.createElement('span'); + const selNode = se.body.querySelector('.se-init-sel') || document.createElement('span'); + selNode.setAttribute('class', 'se-init-sel'); selNode.innerHTML = '&nbsp;'; b.append(selNode);