diff --git a/app/src/config/about.ts b/app/src/config/about.ts index 19fc75f38..94432d4ef 100644 --- a/app/src/config/about.ts +++ b/app/src/config/about.ts @@ -397,6 +397,7 @@ export const about = { window.siyuan.config.system.downloadInstallPkg = downloadInstallPkgElement.checked; }); }); + /// #if !BROWSER const autoLaunchElement = about.element.querySelector("#autoLaunch") as HTMLInputElement; autoLaunchElement.addEventListener("change", () => { fetchPost("/api/system/setAutoLaunch", {autoLaunch: autoLaunchElement.checked}, () => { @@ -404,6 +405,7 @@ export const about = { app.setLoginItemSettings({openAtLogin: autoLaunchElement.checked}); }); }); + /// #endif about.element.querySelector("#aboutConfirm").addEventListener("click", () => { const scheme = (about.element.querySelector("#aboutScheme") as HTMLInputElement).value; const host = (about.element.querySelector("#aboutHost") as HTMLInputElement).value; diff --git a/kernel/model/box.go b/kernel/model/box.go index f6ef21498..1020549a3 100644 --- a/kernel/model/box.go +++ b/kernel/model/box.go @@ -464,6 +464,10 @@ func parseKTree(kramdown []byte) (ret *parse.Tree) { } func genTreeID(tree *parse.Tree) { + if nil == tree.Root.FirstChild { + tree.Root.AppendChild(parse.NewParagraph()) + } + ast.Walk(tree.Root, func(n *ast.Node, entering bool) ast.WalkStatus { if !entering { return ast.WalkContinue