🎨 Improve handling of assets when exporting to Word .docx format https://github.com/siyuan-note/siyuan/issues/15253

Signed-off-by: Daniel <845765@qq.com>
This commit is contained in:
Daniel 2026-01-09 23:34:52 +08:00
parent 9e2a0f59bc
commit feb5f0cefe
No known key found for this signature in database
GPG key ID: 86211BA83DF03017

View file

@ -800,6 +800,9 @@ func ExportMarkdownHTML(id, savePath string, docx, merge bool) (name, dom string
if ast.NodeLinkDest == n.Type {
if bytes.HasPrefix(n.Tokens, []byte("file://")) {
n.Tokens = bytes.ReplaceAll(n.Tokens, []byte("\\"), []byte("/"))
if !bytes.HasPrefix(n.Tokens, []byte("file:///")) {
n.Tokens = bytes.ReplaceAll(n.Tokens, []byte("file://"), []byte("file:///"))
}
}
}
return ast.WalkContinue