diff --git a/app/src/assets/template/app/index.tpl b/app/src/assets/template/app/index.tpl
index cbd8c95da..e1c19c495 100644
--- a/app/src/assets/template/app/index.tpl
+++ b/app/src/assets/template/app/index.tpl
@@ -4,7 +4,6 @@
-
diff --git a/app/src/assets/template/app/window.tpl b/app/src/assets/template/app/window.tpl
index 1fa994395..035aa3359 100644
--- a/app/src/assets/template/app/window.tpl
+++ b/app/src/assets/template/app/window.tpl
@@ -7,7 +7,6 @@
-
diff --git a/app/src/assets/template/desktop/index.tpl b/app/src/assets/template/desktop/index.tpl
index 255a0e4e9..cbbe239bc 100644
--- a/app/src/assets/template/desktop/index.tpl
+++ b/app/src/assets/template/desktop/index.tpl
@@ -8,7 +8,6 @@
-
diff --git a/app/src/assets/template/mobile/index.tpl b/app/src/assets/template/mobile/index.tpl
index fe6269454..28f4d4b7d 100644
--- a/app/src/assets/template/mobile/index.tpl
+++ b/app/src/assets/template/mobile/index.tpl
@@ -4,7 +4,6 @@
-
diff --git a/app/src/plugin/loader.ts b/app/src/plugin/loader.ts
index 1ce2270f4..11f09b252 100644
--- a/app/src/plugin/loader.ts
+++ b/app/src/plugin/loader.ts
@@ -29,10 +29,12 @@ export const loadPlugins = async (app: App) => {
loadPluginJS(app, item);
css += item.css || "" + "\n";
});
- const styleElement = document.createElement("style");
- styleElement.id = "pluginsStyle";
- styleElement.textContent = css;
- document.head.append(styleElement);
+ const pluginsStyle = document.getElementById("pluginsStyle")
+ if (pluginsStyle) {
+ pluginsStyle.innerHTML = css;
+ } else {
+ document.head.insertAdjacentHTML("beforeend", ``);
+ }
};
const loadPluginJS = async (app: App, item: IPluginData) => {
diff --git a/app/src/util/assets.ts b/app/src/util/assets.ts
index 634747519..ff9a42207 100644
--- a/app/src/util/assets.ts
+++ b/app/src/util/assets.ts
@@ -218,14 +218,19 @@ export const setInlineStyle = (set = true) => {
.protyle-wysiwyg .h5 img.emoji, .b3-typography h5 img.emoji {width:${Math.floor(window.siyuan.config.editor.fontSize * 1.13 * 1.25)}px}
.protyle-wysiwyg .h6 img.emoji, .b3-typography h6 img.emoji {width:${Math.floor(window.siyuan.config.editor.fontSize * 1.25)}px}`;
if (window.siyuan.config.editor.fontFamily) {
- style += `\n.b3-typography:not(.b3-typography--default), .protyle-wysiwyg, .protyle-title, .protyle-title__input{font-family: "${window.siyuan.config.editor.fontFamily}", "Helvetica Neue", "Luxi Sans", "DejaVu Sans", "Hiragino Sans GB", "Microsoft Yahei", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Segoe UI Symbol", "Android Emoji", "EmojiSymbols" !important;}`;
+ style += `\n.b3-typography:not(.b3-typography--default), .protyle {font-family: "${window.siyuan.config.editor.fontFamily}", var(--b3-font-family)}`;
}
// pad 端菜单移除显示,如工作空间
if ("ontouchend" in document) {
style += "\n.b3-menu .b3-menu__action {opacity: 0.68;}";
}
if (set) {
- document.getElementById("editorFontSize").innerHTML = style;
+ const siyuanStyle = document.getElementById("siyuanStyle")
+ if (siyuanStyle) {
+ siyuanStyle.innerHTML = style;
+ } else {
+ document.head.insertAdjacentHTML("beforeend", ``);
+ }
}
return style;
};