Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/dev' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
Vanessa219 committed Oct 21, 2023
2 parents bb21808 + 0c2f466 commit bbb1abb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/src/layout/dock/Outline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,11 @@ export class Outline extends Model {
});
}
} else {
fetchPost("/api/attr/getBlockAttrs", {id}, (attrResponse) => {
fetchPost("/api/block/checkBlockFold", {id}, (foldResponse) => {
openFileById({
app: options.app,
id,
action: attrResponse.data["heading-fold"] === "1" ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL, Constants.CB_GET_HTML] : [Constants.CB_GET_FOCUS, Constants.CB_GET_SETID, Constants.CB_GET_CONTEXT, Constants.CB_GET_HTML],
action: foldResponse.data ? [Constants.CB_GET_FOCUS, Constants.CB_GET_ALL, Constants.CB_GET_HTML] : [Constants.CB_GET_FOCUS, Constants.CB_GET_SETID, Constants.CB_GET_CONTEXT, Constants.CB_GET_HTML],
});
});
}
Expand Down
6 changes: 6 additions & 0 deletions kernel/model/blockial.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import (
"github.com/88250/lute/lex"
"github.com/88250/lute/parse"
"github.com/araddon/dateparse"
"github.com/siyuan-note/logging"
"github.com/siyuan-note/siyuan/kernel/cache"
"github.com/siyuan-note/siyuan/kernel/sql"
"github.com/siyuan-note/siyuan/kernel/treenode"
Expand Down Expand Up @@ -256,6 +257,11 @@ func GetBlockAttrs(id string) (ret map[string]string) {
}

node := treenode.GetNodeInTree(tree, id)
if nil == node {
logging.LogWarnf("block [%s] not found", id)
return
}

for _, kv := range node.KramdownIAL {
ret[kv[0]] = html.UnescapeAttrVal(kv[1])
}
Expand Down

0 comments on commit bbb1abb

Please sign in to comment.