Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art: Improve exporting docx https://github.com/siyuan-note/siyuan/issues/14825

Daniela06da150a60f
diff --git a/kernel/model/export.go b/kernel/model/export.go
index 0b9688cf08..8554d92815 100644
--- a/kernel/model/export.go
+++ b/kernel/model/export.go
@@ -793,6 +793,11 @@ func ExportMarkdownHTML(id, savePath string, docx, merge bool) (name, dom string
n.ListData.Start = li.ListData.Num
}
}
+ } else if n.IsTextMarkType("code") {
+ if nil != n.Next && ast.NodeText == n.Next.Type {
+ // 行级代码导出 word 之后会有多余的零宽空格 https://github.com/siyuan-note/siyuan/issues/14825
+ n.Next.Tokens = bytes.TrimPrefix(n.Tokens, []byte(editor.Zwsp))
+ }
}
return ast.WalkContinue
})