From aebd1b57fc0de80f5a8efbfee28e96b70e93db3d Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Thu, 21 Mar 2019 10:05:31 -0400 Subject: [PATCH] make sure there isn't more content after newline --- src/angular/directives/flex-copy.directive.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/angular/directives/flex-copy.directive.ts b/src/angular/directives/flex-copy.directive.ts index 89607fdedc..6bdf387f7c 100644 --- a/src/angular/directives/flex-copy.directive.ts +++ b/src/angular/directives/flex-copy.directive.ts @@ -29,7 +29,10 @@ export class FlexCopyDirective { let stringEndPos = text.length; const newLinePos = text.search(/(?:\r\n|\r|\n)/); if (newLinePos > -1) { - stringEndPos = newLinePos; + const otherPart = text.substr(newLinePos).trim(); + if (otherPart === '') { + stringEndPos = newLinePos; + } } copyText += text.substring(0, stringEndPos); }