mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-15 19:48:06 +01:00
This commit is contained in:
parent
09b0d73e77
commit
708da7c753
1 changed files with 10 additions and 8 deletions
|
|
@ -485,15 +485,17 @@ export class Toolbar {
|
|||
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;
|
||||
setFontStyle(inlineElement, textObj);
|
||||
if (item.textContent) {
|
||||
const inlineElement = document.createElement("span");
|
||||
inlineElement.setAttribute("data-type", type);
|
||||
inlineElement.textContent = item.textContent;
|
||||
setFontStyle(inlineElement, textObj);
|
||||
|
||||
if (type === "text" && !inlineElement.getAttribute("style")) {
|
||||
newNodes.push(item);
|
||||
} else {
|
||||
newNodes.push(inlineElement);
|
||||
if (type === "text" && !inlineElement.getAttribute("style")) {
|
||||
newNodes.push(item);
|
||||
} else {
|
||||
newNodes.push(inlineElement);
|
||||
}
|
||||
}
|
||||
} else if (item.nodeType === 1) {
|
||||
let types = (item.getAttribute("data-type") || "").split(" ");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue