mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-02 23:08:49 +01:00
This commit is contained in:
parent
23ad4af81f
commit
35ccbaa0f0
1 changed files with 9 additions and 0 deletions
|
|
@ -446,6 +446,7 @@ export class Toolbar {
|
|||
}
|
||||
}
|
||||
contents.childNodes.forEach((item: HTMLElement, index) => {
|
||||
let removeText = "";
|
||||
if (item.nodeType === 3) {
|
||||
if (index === 0 && previousElement && previousElement.nodeType !== 3 &&
|
||||
type === previousElement.getAttribute("data-type") &&
|
||||
|
|
@ -467,6 +468,11 @@ export class Toolbar {
|
|||
newNodes.push(document.createTextNode(Constants.ZWSP));
|
||||
item.textContent = item.textContent.substring(1);
|
||||
}
|
||||
// https://github.com/siyuan-note/siyuan/issues/14204
|
||||
while (item.textContent.endsWith("\n")) {
|
||||
item.textContent = item.textContent.substring(0, item.textContent.length - 1);
|
||||
removeText += "\n";
|
||||
}
|
||||
const inlineElement = document.createElement("span");
|
||||
inlineElement.setAttribute("data-type", type);
|
||||
inlineElement.textContent = item.textContent;
|
||||
|
|
@ -588,6 +594,9 @@ export class Toolbar {
|
|||
newNodes.push(item);
|
||||
}
|
||||
}
|
||||
if (removeText) {
|
||||
newNodes.push(document.createTextNode(removeText));
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue