🐛 Export file is incomplete https://github.com/siyuan-note/siyuan/issues/8279
This commit is contained in:
parent
a732e17190
commit
c52da0c315
1 changed files with 6 additions and 5 deletions
|
@ -36,6 +36,7 @@ import (
|
|||
|
||||
type BlockInfo struct {
|
||||
ID string `json:"id"`
|
||||
RootID string `json:"rootID"`
|
||||
Name string `json:"name"`
|
||||
RefCount int `json:"refCount"`
|
||||
SubFileCount int `json:"subFileCount"`
|
||||
|
@ -44,17 +45,17 @@ type BlockInfo struct {
|
|||
Icon string `json:"icon"`
|
||||
}
|
||||
|
||||
func GetDocInfo(rootID string) (ret *BlockInfo) {
|
||||
func GetDocInfo(blockID string) (ret *BlockInfo) {
|
||||
WaitForWritingFiles()
|
||||
|
||||
tree, err := loadTreeByBlockID(rootID)
|
||||
tree, err := loadTreeByBlockID(blockID)
|
||||
if nil != err {
|
||||
logging.LogErrorf("load tree by root id [%s] failed: %s", rootID, err)
|
||||
logging.LogErrorf("load tree by root id [%s] failed: %s", blockID, err)
|
||||
return
|
||||
}
|
||||
|
||||
title := tree.Root.IALAttr("title")
|
||||
ret = &BlockInfo{ID: rootID, Name: title}
|
||||
ret = &BlockInfo{ID: blockID, RootID: tree.Root.ID, Name: title}
|
||||
ret.IAL = parse.IAL2Map(tree.Root.KramdownIAL)
|
||||
scrollData := ret.IAL["scroll"]
|
||||
if 0 < len(scrollData) {
|
||||
|
@ -81,7 +82,7 @@ func GetDocInfo(rootID string) (ret *BlockInfo) {
|
|||
}
|
||||
}
|
||||
}
|
||||
ret.RefIDs, _ = sql.QueryRefIDsByDefID(rootID, false)
|
||||
ret.RefIDs, _ = sql.QueryRefIDsByDefID(blockID, false)
|
||||
ret.RefCount = len(ret.RefIDs)
|
||||
|
||||
var subFileCount int
|
||||
|
|
Loading…
Add table
Reference in a new issue