mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-22 01:20:12 +01:00
This commit is contained in:
parent
dfbd697ab5
commit
a48e78d55f
1 changed files with 13 additions and 1 deletions
|
|
@ -519,7 +519,13 @@ export class Toolbar {
|
||||||
if (item.textContent) {
|
if (item.textContent) {
|
||||||
const inlineElement = document.createElement("span");
|
const inlineElement = document.createElement("span");
|
||||||
inlineElement.setAttribute("data-type", type);
|
inlineElement.setAttribute("data-type", type);
|
||||||
inlineElement.textContent = type === "a" ? (item.textContent.trim() || "*") : item.textContent;
|
inlineElement.textContent = item.textContent;
|
||||||
|
if (type === "a") {
|
||||||
|
if (!inlineElement.textContent) {
|
||||||
|
inlineElement.textContent = "*";
|
||||||
|
}
|
||||||
|
textObj.color = textObj.color.split(Constants.ZWSP)[0];
|
||||||
|
}
|
||||||
setFontStyle(inlineElement, textObj);
|
setFontStyle(inlineElement, textObj);
|
||||||
|
|
||||||
if (type === "text" && !inlineElement.getAttribute("style")) {
|
if (type === "text" && !inlineElement.getAttribute("style")) {
|
||||||
|
|
@ -605,6 +611,12 @@ export class Toolbar {
|
||||||
types = [...new Set(types)];
|
types = [...new Set(types)];
|
||||||
if (item.tagName !== "BR" && item.tagName !== "IMG" && !types.includes("img")) {
|
if (item.tagName !== "BR" && item.tagName !== "IMG" && !types.includes("img")) {
|
||||||
item.setAttribute("data-type", types.join(" "));
|
item.setAttribute("data-type", types.join(" "));
|
||||||
|
if (type === "a") {
|
||||||
|
if (!item.textContent) {
|
||||||
|
item.textContent = "*";
|
||||||
|
}
|
||||||
|
textObj.color = textObj.color.split(Constants.ZWSP)[0];
|
||||||
|
}
|
||||||
setFontStyle(item, textObj);
|
setFontStyle(item, textObj);
|
||||||
if (types.includes("text") && !item.getAttribute("style")) {
|
if (types.includes("text") && !item.getAttribute("style")) {
|
||||||
if (types.length === 1) {
|
if (types.length === 1) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue