mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-01 22:38:49 +01:00
🎨 Query embed block supports executing JavaScript https://github.com/siyuan-note/siyuan/issues/9648
This commit is contained in:
parent
7a0aab7eac
commit
e24a724630
5 changed files with 59 additions and 3 deletions
|
|
@ -215,7 +215,13 @@ func IndexEmbedBlockJob() {
|
|||
|
||||
func autoIndexEmbedBlock(embedBlocks []*sql.Block) {
|
||||
for i, embedBlock := range embedBlocks {
|
||||
stmt := strings.TrimPrefix(embedBlock.Markdown, "{{")
|
||||
md := strings.TrimSpace(embedBlock.Markdown)
|
||||
if strings.Contains(md, "//js") {
|
||||
// js 嵌入块不支持自动索引
|
||||
continue
|
||||
}
|
||||
|
||||
stmt := strings.TrimPrefix(md, "{{")
|
||||
stmt = strings.TrimSuffix(stmt, "}}")
|
||||
if !strings.Contains(strings.ToLower(stmt), "select") {
|
||||
continue
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue