Skip to content

Commit

Permalink
When pasting text, only trim newline characters (#237)
Browse files Browse the repository at this point in the history
Regression introduced in #219. Fixes #236 and #229.
  • Loading branch information
dbrgn authored May 29, 2017
1 parent 14ac22c commit b5af08d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/directives/compose_area.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,8 @@ export default [
const node = composeDiv[0].childNodes[i];
switch (node.nodeType) {
case Node.TEXT_NODE:
text += node.nodeValue.trim();
// Append text, but strip leading and trailing newlines
text += node.nodeValue.replace(/(^[\r\n]*|[\r\n]*$)/g, '');
break;
case Node.ELEMENT_NODE:
const tag = node.tagName.toLowerCase();
Expand Down

0 comments on commit b5af08d

Please sign in to comment.