mirror of
https://github.com/bitwarden/browser
synced 2025-12-16 08:13:42 +00:00
make sure there isn't more content after newline
This commit is contained in:
@@ -29,7 +29,10 @@ export class FlexCopyDirective {
|
|||||||
let stringEndPos = text.length;
|
let stringEndPos = text.length;
|
||||||
const newLinePos = text.search(/(?:\r\n|\r|\n)/);
|
const newLinePos = text.search(/(?:\r\n|\r|\n)/);
|
||||||
if (newLinePos > -1) {
|
if (newLinePos > -1) {
|
||||||
stringEndPos = newLinePos;
|
const otherPart = text.substr(newLinePos).trim();
|
||||||
|
if (otherPart === '') {
|
||||||
|
stringEndPos = newLinePos;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
copyText += text.substring(0, stringEndPos);
|
copyText += text.substring(0, stringEndPos);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user