mirror of
https://github.com/bitwarden/browser.git
synced 2024-11-07 09:31:31 +01:00
make sure there isn't more content after newline
This commit is contained in:
parent
7bd0733b88
commit
aebd1b57fc
@ -29,8 +29,11 @@ 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) {
|
||||||
|
const otherPart = text.substr(newLinePos).trim();
|
||||||
|
if (otherPart === '') {
|
||||||
stringEndPos = newLinePos;
|
stringEndPos = newLinePos;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
copyText += text.substring(0, stringEndPos);
|
copyText += text.substring(0, stringEndPos);
|
||||||
}
|
}
|
||||||
this.platformUtilsService.copyToClipboard(copyText, { window: window });
|
this.platformUtilsService.copyToClipboard(copyText, { window: window });
|
||||||
|
Loading…
Reference in New Issue
Block a user