Skip to content

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

:art: Cloud inbox support preview audio and video https://github.com/siyuan-note/siyuan/issues/9780

Daniela1827d1f5091
diff --git a/kernel/model/cloud_service.go b/kernel/model/cloud_service.go
index c9c33affa6..85ff31f977 100644
--- a/kernel/model/cloud_service.go
+++ b/kernel/model/cloud_service.go
@@ -498,6 +498,7 @@ func GetCloudShorthands(page int) (result map[string]interface{}, err error) {
luteEngine := NewLute()
audioRegexp := regexp.MustCompile("<audio.*>.*</audio>")
videoRegexp := regexp.MustCompile("<video.*>.*</video>")
+ fileRegexp := regexp.MustCompile("\\[文件]\\(.*\\)")
shorthands := result["data"].(map[string]interface{})["shorthands"].([]interface{})
for _, item := range shorthands {
shorthand := item.(map[string]interface{})
@@ -509,6 +510,7 @@ func GetCloudShorthands(page int) (result map[string]interface{}, err error) {
desc := shorthand["shorthandDesc"].(string)
desc = audioRegexp.ReplaceAllString(desc, " 语音 ")
desc = videoRegexp.ReplaceAllString(desc, " 视频 ")
+ desc = fileRegexp.ReplaceAllString(desc, " 文件 ")
desc = strings.ReplaceAll(desc, "\n\n", "")
desc = strings.TrimSpace(desc)
shorthand["shorthandDesc"] = desc