mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-17 07:00:12 +01:00
Signed-off-by: Daniel <845765@qq.com>
This commit is contained in:
parent
b3a4068cea
commit
60c49dbfe9
1 changed files with 4 additions and 2 deletions
|
|
@ -2162,9 +2162,11 @@ func exportMarkdownContent0(id string, tree *parse.Tree, cloudAssetsBase string,
|
||||||
href = "#" + defID
|
href = "#" + defID
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
href = strings.TrimPrefix(href, currentDocDir)
|
newHref := strings.TrimPrefix(href, currentDocDir)
|
||||||
|
if !strings.HasPrefix(newHref, ".md") {
|
||||||
|
href = newHref
|
||||||
|
}
|
||||||
href = util.FilterFilePath(href)
|
href = util.FilterFilePath(href)
|
||||||
href = strings.TrimPrefix(href, "/")
|
|
||||||
blockRefLink := &ast.Node{Type: ast.NodeTextMark, TextMarkType: "a", TextMarkTextContent: linkText, TextMarkAHref: href}
|
blockRefLink := &ast.Node{Type: ast.NodeTextMark, TextMarkType: "a", TextMarkTextContent: linkText, TextMarkAHref: href}
|
||||||
blockRefLink.KramdownIAL = n.KramdownIAL
|
blockRefLink.KramdownIAL = n.KramdownIAL
|
||||||
n.InsertBefore(blockRefLink)
|
n.InsertBefore(blockRefLink)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue