From d510a74aab7585ff974e18eb52cd42a6f1b9b197 Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Sat, 27 Aug 2022 21:46:32 +0800 Subject: [PATCH] =?UTF-8?q?:art:=20=E6=95=B0=E5=AD=A6=E5=85=AC=E5=BC=8F?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E8=AE=BE=E7=BD=AE=E5=85=A8=E5=B1=80=E5=AE=8F?= =?UTF-8?q?=E5=AE=9A=E4=B9=89=20https://github.com/siyuan-note/siyuan/issu?= =?UTF-8?q?es/5682?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- kernel/api/setting.go | 4 ++++ kernel/conf/editor.go | 2 ++ 2 files changed, 6 insertions(+) diff --git a/kernel/api/setting.go b/kernel/api/setting.go index 2664f79e1..6ecd3917f 100644 --- a/kernel/api/setting.go +++ b/kernel/api/setting.go @@ -87,6 +87,10 @@ func setEditor(c *gin.Context) { editor.PlantUMLServePath = "https://www.plantuml.com/plantuml/svg/~1" } + if "" == editor.KaTexMacros { + editor.KaTexMacros = "{}" + } + model.Conf.Editor = editor model.Conf.Save() diff --git a/kernel/conf/editor.go b/kernel/conf/editor.go index d787a41cf..461a78ff9 100644 --- a/kernel/conf/editor.go +++ b/kernel/conf/editor.go @@ -33,6 +33,7 @@ type Editor struct { BlockRefDynamicAnchorTextMaxLen int `json:"blockRefDynamicAnchorTextMaxLen"` // 块引动态锚文本最大长度 PlantUMLServePath string `json:"plantUMLServePath"` // PlantUML 伺服地址 FullWidth bool `json:"fullWidth"` // 是否使用最大宽度 + KaTexMacros string `json:"kaTexMacros"` // KeTex 宏定义 } func NewEditor() *Editor { @@ -51,5 +52,6 @@ func NewEditor() *Editor { BlockRefDynamicAnchorTextMaxLen: 96, PlantUMLServePath: "https://www.plantuml.com/plantuml/svg/~1", FullWidth: true, + KaTexMacros: "{}", } }