mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-22 17:40:13 +01:00
🎨 Cloud inbox support preview audio and video https://github.com/siyuan-note/siyuan/issues/9780
This commit is contained in:
parent
3d8d1ef544
commit
a1827d1f50
1 changed files with 2 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue