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 a792220ffa1dde1ba87f6a3fdfa37587a955ebc1
parent e1efc7794bd9f59ad79b31a70bb481c0962df6ec
Author: Henry Unite <unitehenry@gmail.com>
Date:   Wed, 23 Sep 2020 20:44:39 -0400

check pure content for textDecorationInsert on init

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

diff --git a/src/striveneditor.js b/src/striveneditor.js @@ -3178,22 +3178,22 @@ export default class StrivenEditor { } break; case 'bold': - if(se.body.textContent === '') { + if(se.body.textContent.trim() === '') { textDecorationInsert('b'); break; } case 'italic': - if(se.body.textContent === '') { + if(se.body.textContent.trim() === '') { textDecorationInsert('i'); break; } case 'underline': - if(se.body.textContent === '') { + if(se.body.textContent.trim() === '') { textDecorationInsert('u'); break; } case 'strikethrough': - if(se.body.textContent === '') { + if(se.body.textContent.trim() === '') { textDecorationInsert('strike'); break; }