mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-17 07:00:12 +01:00
🎨 Add ial for building embed block
This commit is contained in:
parent
59dcc2637a
commit
80b68e6eb9
1 changed files with 11 additions and 0 deletions
|
|
@ -20,6 +20,7 @@ import (
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/88250/lute/ast"
|
"github.com/88250/lute/ast"
|
||||||
|
|
@ -647,6 +648,16 @@ func getEmbeddedBlock(trees map[string]*parse.Tree, sqlBlock *sql.Block, heading
|
||||||
content := renderBlockContentByNodes(nodes)
|
content := renderBlockContentByNodes(nodes)
|
||||||
block = &Block{Box: def.Box, Path: def.Path, HPath: b.HPath, ID: def.ID, Type: def.Type.String(), Content: dom, Markdown: content /* 这里使用 Markdown 字段来临时存储 content */}
|
block = &Block{Box: def.Box, Path: def.Path, HPath: b.HPath, ID: def.ID, Type: def.Type.String(), Content: dom, Markdown: content /* 这里使用 Markdown 字段来临时存储 content */}
|
||||||
|
|
||||||
|
if "" != sqlBlock.IAL {
|
||||||
|
block.IAL = map[string]string{}
|
||||||
|
ialStr := strings.TrimPrefix(sqlBlock.IAL, "{:")
|
||||||
|
ialStr = strings.TrimSuffix(ialStr, "}")
|
||||||
|
ial := parse.Tokens2IAL([]byte(ialStr))
|
||||||
|
for _, kv := range ial {
|
||||||
|
block.IAL[kv[0]] = kv[1]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if breadcrumb {
|
if breadcrumb {
|
||||||
blockPaths = buildBlockBreadcrumb(def, nil)
|
blockPaths = buildBlockBreadcrumb(def, nil)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue