mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-06 00:38:49 +01:00
🎨 Documents created via the database are no longer automatically hidden Fix https://github.com/siyuan-note/siyuan/issues/9298
This commit is contained in:
parent
4c47fdbdb1
commit
3842a17d07
4 changed files with 10 additions and 25 deletions
|
|
@ -1019,7 +1019,7 @@ func CreateDocByMd(boxID, p, title, md string, sorts []string) (tree *parse.Tree
|
|||
|
||||
luteEngine := util.NewLute()
|
||||
dom := luteEngine.Md2BlockDOM(md, false)
|
||||
tree, err = createDoc(box.ID, p, title, dom, true)
|
||||
tree, err = createDoc(box.ID, p, title, dom)
|
||||
if nil != err {
|
||||
return
|
||||
}
|
||||
|
|
@ -1028,7 +1028,7 @@ func CreateDocByMd(boxID, p, title, md string, sorts []string) (tree *parse.Tree
|
|||
return
|
||||
}
|
||||
|
||||
func CreateWithMarkdown(boxID, hPath, md, parentID string, hidden bool) (id string, err error) {
|
||||
func CreateWithMarkdown(boxID, hPath, md, parentID string) (id string, err error) {
|
||||
box := Conf.Box(boxID)
|
||||
if nil == box {
|
||||
err = errors.New(Conf.Language(0))
|
||||
|
|
@ -1038,7 +1038,7 @@ func CreateWithMarkdown(boxID, hPath, md, parentID string, hidden bool) (id stri
|
|||
WaitForWritingFiles()
|
||||
luteEngine := util.NewLute()
|
||||
dom := luteEngine.Md2BlockDOM(md, false)
|
||||
id, _, err = createDocsByHPath(box.ID, hPath, dom, parentID, hidden)
|
||||
id, _, err = createDocsByHPath(box.ID, hPath, dom, parentID)
|
||||
return
|
||||
}
|
||||
|
||||
|
|
@ -1442,7 +1442,7 @@ func CreateDailyNote(boxID string) (p string, existed bool, err error) {
|
|||
return
|
||||
}
|
||||
|
||||
id, existed, err := createDocsByHPath(box.ID, hPath, "", "", true)
|
||||
id, existed, err := createDocsByHPath(box.ID, hPath, "", "")
|
||||
if nil != err {
|
||||
return
|
||||
}
|
||||
|
|
@ -1487,7 +1487,7 @@ func CreateDailyNote(boxID string) (p string, existed bool, err error) {
|
|||
return
|
||||
}
|
||||
|
||||
func createDoc(boxID, p, title, dom string, hidden bool) (tree *parse.Tree, err error) {
|
||||
func createDoc(boxID, p, title, dom string) (tree *parse.Tree, err error) {
|
||||
title = gulu.Str.RemoveInvisible(title)
|
||||
if 512 < utf8.RuneCountInString(title) {
|
||||
// 限制笔记本名和文档名最大长度为 `512` https://github.com/siyuan-note/siyuan/issues/6299
|
||||
|
|
@ -1559,10 +1559,6 @@ func createDoc(boxID, p, title, dom string, hidden bool) (tree *parse.Tree, err
|
|||
tree.Root.AppendChild(treenode.NewParagraph())
|
||||
}
|
||||
|
||||
if !hidden {
|
||||
tree.Root.SetIALAttr("custom-hidden", "true")
|
||||
}
|
||||
|
||||
transaction := &Transaction{DoOperations: []*Operation{{Action: "create", Data: tree}}}
|
||||
PerformTransactions(&[]*Transaction{transaction})
|
||||
WaitForWritingFiles()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue