Signed-off-by: Daniel <845765@qq.com>
This commit is contained in:
Daniel 2025-10-10 12:43:01 +08:00
parent b3a4068cea
commit 60c49dbfe9
No known key found for this signature in database
GPG key ID: 86211BA83DF03017

View file

@ -2162,9 +2162,11 @@ func exportMarkdownContent0(id string, tree *parse.Tree, cloudAssetsBase string,
href = "#" + defID
}
}
href = strings.TrimPrefix(href, currentDocDir)
newHref := strings.TrimPrefix(href, currentDocDir)
if !strings.HasPrefix(newHref, ".md") {
href = newHref
}
href = util.FilterFilePath(href)
href = strings.TrimPrefix(href, "/")
blockRefLink := &ast.Node{Type: ast.NodeTextMark, TextMarkType: "a", TextMarkTextContent: linkText, TextMarkAHref: href}
blockRefLink.KramdownIAL = n.KramdownIAL
n.InsertBefore(blockRefLink)