mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-22 01:20:12 +01:00
🐛 嵌入块 SQL 脚本中存在换行时无法导出 Fix https://github.com/siyuan-note/siyuan/issues/7771
This commit is contained in:
parent
2f51a072f9
commit
23c0b52e9a
2 changed files with 4 additions and 0 deletions
|
|
@ -1561,6 +1561,7 @@ func exportTree(tree *parse.Tree, wysiwyg, expandKaTexMacros, keepFold bool,
|
||||||
var defMd string
|
var defMd string
|
||||||
stmt := n.ChildByType(ast.NodeBlockQueryEmbedScript).TokensStr()
|
stmt := n.ChildByType(ast.NodeBlockQueryEmbedScript).TokensStr()
|
||||||
stmt = html.UnescapeString(stmt)
|
stmt = html.UnescapeString(stmt)
|
||||||
|
stmt = strings.ReplaceAll(stmt, editor.IALValEscNewLine, "\n")
|
||||||
embedBlocks := searchEmbedBlock(n.ID, stmt, nil, 0, false)
|
embedBlocks := searchEmbedBlock(n.ID, stmt, nil, 0, false)
|
||||||
if 1 > len(embedBlocks) {
|
if 1 > len(embedBlocks) {
|
||||||
return ast.WalkContinue
|
return ast.WalkContinue
|
||||||
|
|
@ -1875,6 +1876,7 @@ func resolveFootnotesDefs(refFootnotes *[]*refAsFootnotes, rootID string, blockR
|
||||||
} else if ast.NodeBlockQueryEmbed == n.Type {
|
} else if ast.NodeBlockQueryEmbed == n.Type {
|
||||||
stmt := n.ChildByType(ast.NodeBlockQueryEmbedScript).TokensStr()
|
stmt := n.ChildByType(ast.NodeBlockQueryEmbedScript).TokensStr()
|
||||||
stmt = html.UnescapeString(stmt)
|
stmt = html.UnescapeString(stmt)
|
||||||
|
stmt = strings.ReplaceAll(stmt, editor.IALValEscNewLine, "\n")
|
||||||
sqlBlocks := sql.SelectBlocksRawStmt(stmt, Conf.Search.Limit)
|
sqlBlocks := sql.SelectBlocksRawStmt(stmt, Conf.Search.Limit)
|
||||||
for _, b := range sqlBlocks {
|
for _, b := range sqlBlocks {
|
||||||
subNodes := renderBlockMarkdownR0(b.ID, &rendered)
|
subNodes := renderBlockMarkdownR0(b.ID, &rendered)
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,7 @@ package model
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
|
"github.com/88250/lute/editor"
|
||||||
"regexp"
|
"regexp"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
|
|
@ -203,6 +204,7 @@ func renderBlockMarkdownR0(id string, rendered *[]string) (ret []*ast.Node) {
|
||||||
if ast.NodeBlockQueryEmbed == n.Type {
|
if ast.NodeBlockQueryEmbed == n.Type {
|
||||||
stmt := n.ChildByType(ast.NodeBlockQueryEmbedScript).TokensStr()
|
stmt := n.ChildByType(ast.NodeBlockQueryEmbedScript).TokensStr()
|
||||||
stmt = html.UnescapeString(stmt)
|
stmt = html.UnescapeString(stmt)
|
||||||
|
stmt = strings.ReplaceAll(stmt, editor.IALValEscNewLine, "\n")
|
||||||
sqlBlocks := sql.SelectBlocksRawStmt(stmt, Conf.Search.Limit)
|
sqlBlocks := sql.SelectBlocksRawStmt(stmt, Conf.Search.Limit)
|
||||||
for _, sqlBlock := range sqlBlocks {
|
for _, sqlBlock := range sqlBlocks {
|
||||||
subNodes := renderBlockMarkdownR0(sqlBlock.ID, rendered)
|
subNodes := renderBlockMarkdownR0(sqlBlock.ID, rendered)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue