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 7f49860f1ab46956563955319fdb284b962e9b5f
parent ed368e1582da1429a594d32107dacd09d66a5969
Author: Henry Unite <unitehenry@gmail.com>
Date:   Thu, 15 Oct 2020 18:58:03 -0400

only allow link menu with single line

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

diff --git a/src/striveneditor.js b/src/striveneditor.js @@ -3270,7 +3270,11 @@ export default class StrivenEditor { const r = se.getRange(); const rnode = document.createElement('div'); rnode.append(r.cloneContents().cloneNode(true)); - + + if(rnode.querySelector('br')){ + return; + } + const rLink = rnode.querySelector('a'); if(rLink) { const linkRepl = document.createElement('a');