Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
Vanessa 2022-12-10 11:46:12 +08:00
commit ec8c1bc03c
2 changed files with 6 additions and 0 deletions

View File

@ -397,6 +397,7 @@ export const about = {
window.siyuan.config.system.downloadInstallPkg = downloadInstallPkgElement.checked; window.siyuan.config.system.downloadInstallPkg = downloadInstallPkgElement.checked;
}); });
}); });
/// #if !BROWSER
const autoLaunchElement = about.element.querySelector("#autoLaunch") as HTMLInputElement; const autoLaunchElement = about.element.querySelector("#autoLaunch") as HTMLInputElement;
autoLaunchElement.addEventListener("change", () => { autoLaunchElement.addEventListener("change", () => {
fetchPost("/api/system/setAutoLaunch", {autoLaunch: autoLaunchElement.checked}, () => { fetchPost("/api/system/setAutoLaunch", {autoLaunch: autoLaunchElement.checked}, () => {
@ -404,6 +405,7 @@ export const about = {
app.setLoginItemSettings({openAtLogin: autoLaunchElement.checked}); app.setLoginItemSettings({openAtLogin: autoLaunchElement.checked});
}); });
}); });
/// #endif
about.element.querySelector("#aboutConfirm").addEventListener("click", () => { about.element.querySelector("#aboutConfirm").addEventListener("click", () => {
const scheme = (about.element.querySelector("#aboutScheme") as HTMLInputElement).value; const scheme = (about.element.querySelector("#aboutScheme") as HTMLInputElement).value;
const host = (about.element.querySelector("#aboutHost") as HTMLInputElement).value; const host = (about.element.querySelector("#aboutHost") as HTMLInputElement).value;

View File

@ -464,6 +464,10 @@ func parseKTree(kramdown []byte) (ret *parse.Tree) {
} }
func genTreeID(tree *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 { ast.Walk(tree.Root, func(n *ast.Node, entering bool) ast.WalkStatus {
if !entering { if !entering {
return ast.WalkContinue return ast.WalkContinue