From: Aleksander Ɓukasz Date: Wed, 18 Dec 2013 10:40:24 +0000 (+0100) Subject: editor: remove new line characters from pasted text X-Git-Url: https://git.mdrn.pl/fnpeditor.git/commitdiff_plain/471681497ab6e3ae9919f4e67f8edfc5e63a0670?ds=sidebyside editor: remove new line characters from pasted text --- diff --git a/src/editor/modules/documentCanvas/canvas/canvas.js b/src/editor/modules/documentCanvas/canvas/canvas.js index 60782c2..70c0f49 100644 --- a/src/editor/modules/documentCanvas/canvas/canvas.js +++ b/src/editor/modules/documentCanvas/canvas/canvas.js @@ -102,7 +102,7 @@ $.extend(Canvas.prototype, { return; // TODO: alert } - var text = clipboardData.getData('text/plain'), + var text = clipboardData.getData('text/plain').replace(/\r?\n|\r/g, ' '), cursor = canvas.getCursor(), element = cursor.getPosition().element, lhs, rhs;