make sure there isn't more content after newline

This commit is contained in:
Kyle Spearrin 2019-03-21 10:05:31 -04:00
parent 7bd0733b88
commit aebd1b57fc
1 changed files with 4 additions and 1 deletions

View File

@ -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);
}