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 95d64f1e6bfe41dd7bdb1a632a20e47f27e49cdf
parent 99e1554d8200abf4b5c7e2bd5dd23fb4fc0939aa
Author: Henry Unite <unitehenry@gmail.com>
Date:   Fri, 28 Aug 2020 13:57:12 -0400

code view getContent

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

diff --git a/src/striveneditor.js b/src/striveneditor.js @@ -1985,7 +1985,8 @@ export default class StrivenEditor { const text = this.body.textContent; if (text || se.body.getElementsByTagName('img').length) { - return se.body.innerHTML; + const htmlView = !!se.editor.querySelector('.se-html'); + return htmlView ? text : se.body.innerHTML; } else { return null; }