mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 22:50:13 +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"
|
||||
"fmt"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/88250/lute/ast"
|
||||
|
|
@ -647,6 +648,16 @@ func getEmbeddedBlock(trees map[string]*parse.Tree, sqlBlock *sql.Block, heading
|
|||
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 */}
|
||||
|
||||
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 {
|
||||
blockPaths = buildBlockBreadcrumb(def, nil)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue