mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-19 21:48:06 +01:00
🎨 Fix code block copy issue with ZWJ https://github.com/siyuan-note/siyuan/issues/14800 (#16770)
This commit is contained in:
parent
27810da357
commit
12456ce23a
5 changed files with 21 additions and 13 deletions
|
|
@ -43,6 +43,8 @@ export const globalClick = (event: MouseEvent & { target: HTMLElement }) => {
|
|||
if (copyElement) {
|
||||
let text = copyElement.parentElement.nextElementSibling.textContent.replace(/\n$/, "");
|
||||
text = text.replace(/\u00A0/g, " "); // Replace non-breaking spaces with normal spaces when copying https://github.com/siyuan-note/siyuan/issues/9382
|
||||
// https://github.com/siyuan-note/siyuan/issues/14800
|
||||
text = text.replace(/\u200D```/g, "```");
|
||||
writeText(text);
|
||||
showMessage(window.siyuan.languages.copied, 2000);
|
||||
event.preventDefault();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue