Liyuan Li пре 5 година
родитељ
комит
18d299e841
2 измењених фајлова са 4 додато и 0 уклоњено
  1. 1 0
      CHANGELOG.md
  2. 3 0
      src/ts/ui/setContentTheme.ts

+ 1 - 0
CHANGELOG.md

@@ -68,6 +68,7 @@
 
 ### v3.3.11 / 2020-07-xx
 
+* [617](https://github.com/Vanessa219/vditor/issues/617) options.preview.theme.current 需设置不使用主题样式 `改进功能`
 * [611](https://github.com/Vanessa219/vditor/issues/611) SV 模式粘贴图片拉取上传问题 `修复缺陷`
 * [616](https://github.com/Vanessa219/vditor/pull/616) fix: safari下选中文字添加标题文字会消失 `修复缺陷`
 * [615](https://github.com/Vanessa219/vditor/issues/615) 即时渲染模式下在safari中光标位置跳动 `修复缺陷`

+ 3 - 0
src/ts/ui/setContentTheme.ts

@@ -1,6 +1,9 @@
 import {addStyle} from "../util/addStyle";
 
 export const setContentTheme = (contentTheme: string, path: string) => {
+    if (!contentTheme || !path) {
+        return;
+    }
     const vditorContentTheme = document.getElementById("vditorContentTheme") as HTMLLinkElement;
     const cssPath = `${path}/${contentTheme}.css`;
     if (!vditorContentTheme) {