mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-16 14:40:12 +01:00
🎨 Improve exporting .sy.zip https://github.com/siyuan-note/siyuan/issues/13011
This commit is contained in:
parent
40cbf3c8c3
commit
a547bb7da2
3 changed files with 16 additions and 20 deletions
|
|
@ -169,7 +169,7 @@ func GetNodeSrcTokens(n *ast.Node) (ret string) {
|
|||
src := n.Tokens[index+len("src=\""):]
|
||||
if index = bytes.Index(src, []byte("\"")); 0 < index {
|
||||
src = src[:bytes.Index(src, []byte("\""))]
|
||||
if !IsRelativePath(src) {
|
||||
if !util.IsAssetLinkDest(src) {
|
||||
return
|
||||
}
|
||||
|
||||
|
|
@ -182,16 +182,6 @@ func GetNodeSrcTokens(n *ast.Node) (ret string) {
|
|||
return
|
||||
}
|
||||
|
||||
func IsRelativePath(dest []byte) bool {
|
||||
if 1 > len(dest) {
|
||||
return false
|
||||
}
|
||||
if '/' == dest[0] {
|
||||
return false
|
||||
}
|
||||
return !bytes.Contains(dest, []byte(":"))
|
||||
}
|
||||
|
||||
func FirstLeafBlock(node *ast.Node) (ret *ast.Node) {
|
||||
ast.Walk(node, func(n *ast.Node, entering bool) ast.WalkStatus {
|
||||
if !entering || n.IsMarker() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue