🎨 Improve the handling of inline-math containing | in the table https://github.com/siyuan-note/siyuan/issues/9227

This commit is contained in:
Daniel 2023-09-25 21:50:02 +08:00
parent 859a541155
commit 734114e052
No known key found for this signature in database
GPG key ID: 86211BA83DF03017
8 changed files with 34 additions and 13 deletions

View file

@ -1357,6 +1357,27 @@ func exportSYZip(boxID, rootDirPath, baseFolderName string, docPaths []string) (
}
}
// 导出数据库 Attribute View export https://github.com/siyuan-note/siyuan/issues/8710
for _, tree := range trees {
ast.Walk(tree.Root, func(n *ast.Node, entering bool) ast.WalkStatus {
if !entering {
return ast.WalkContinue
}
if ast.NodeAttributeView != n.Type {
return ast.WalkContinue
}
avID := n.AttributeViewID
if avJSONPath := av.GetAttributeViewDataPath(avID); !gulu.File.IsExist(avJSONPath) {
return ast.WalkContinue
}
return ast.WalkContinue
})
}
// 导出自定义排序
sortPath := filepath.Join(util.DataDir, box.ID, ".siyuan", "sort.json")
fullSortIDs := map[string]int{}

View file

@ -191,7 +191,7 @@ func ImportSY(zipPath, boxID, toPath string) (err error) {
for _, tree := range trees {
syPath := filepath.Join(unzipRootPath, tree.Path)
if "" == tree.Root.Spec {
parse.NestedInlines2FlattedSpans(tree)
parse.NestedInlines2FlattedSpans(tree, false)
tree.Root.Spec = "1"
}
renderer := render.NewJSONRenderer(tree, luteEngine.RenderOptions)
@ -751,7 +751,7 @@ func parseStdMd(markdown []byte) (ret *parse.Tree) {
}
genTreeID(ret)
imgHtmlBlock2InlineImg(ret)
parse.NestedInlines2FlattedSpansHybrid(ret)
parse.NestedInlines2FlattedSpansHybrid(ret, false)
return
}
@ -1070,7 +1070,7 @@ func buildBlockRefInText() {
}
t := parse.Inline("", n.Tokens, lute.ParseOptions) // 使用行级解析
parse.NestedInlines2FlattedSpans(t)
parse.NestedInlines2FlattedSpans(t, false)
var children []*ast.Node
for c := t.Root.FirstChild.FirstChild; nil != c; c = c.Next {
children = append(children, c)