mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-15 11:38:06 +01:00
This commit is contained in:
parent
ee7e34706a
commit
8ece62c075
2 changed files with 65 additions and 64 deletions
|
|
@ -424,7 +424,7 @@ export class WYSIWYG {
|
|||
}
|
||||
} else if (hasClosestByTag(range.startContainer, "TD") || hasClosestByTag(range.startContainer, "TH")) {
|
||||
tempElement.innerHTML = tempElement.innerHTML.replace(/<br>/g, "\n").replace(/<br\/>/g, "\n");
|
||||
textPlain = tempElement.textContent;
|
||||
textPlain = tempElement.textContent.endsWith("\n") ? tempElement.textContent.replace(/\n$/, "") : tempElement.textContent;
|
||||
} else if (!hasClosestByTag(range.startContainer, "CODE")) {
|
||||
textPlain = range.toString();
|
||||
}
|
||||
|
|
@ -1683,6 +1683,7 @@ export class WYSIWYG {
|
|||
textPlain = textPlain || protyle.lute.BlockDOM2StdMd(html).trimEnd(); // 需要 trimEnd,否则 \n 会导致 https://github.com/siyuan-note/siyuan/issues/6218
|
||||
if (nodeElement.classList.contains("table")) {
|
||||
textPlain = textPlain.replace(/<br>/g, "\n").replace(/<br\/>/g, "\n");
|
||||
textPlain = textPlain.endsWith("\n") ? textPlain.replace(/\n$/, "") : textPlain;
|
||||
}
|
||||
}
|
||||
textPlain = textPlain.replace(/\u00A0/g, " "); // Replace non-breaking spaces with normal spaces when copying https://github.com/siyuan-note/siyuan/issues/9382
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue