Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
TCOTC committed Nov 25, 2024
1 parent 3643c21 commit 8ca78a4
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion app/src/boot/globalEvent/click.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,10 @@ export const globalClick = (event: MouseEvent & { target: HTMLElement }) => {
}
const copyElement = hasTopClosestByClassName(event.target, "protyle-action__copy");
if (copyElement) {
let text = copyElement.parentElement.nextElementSibling.textContent.replace("/\n$/", "");
let text = copyElement.parentElement.nextElementSibling.textContent;
if (!/(\n{2,})$/.test(text)) {
text = text.replace(/\n$/, "");
}
text = text.replace(/\u00A0/g, " "); // Replace non-breaking spaces with normal spaces when copying https://github.com/siyuan-note/siyuan/issues/9382
writeText(text);
showMessage(window.siyuan.languages.copied, 2000);
Expand Down

0 comments on commit 8ca78a4

Please sign in to comment.