Commit 16c7ce5 1 parent a67132a commit 16c7ce5 Copy full SHA for 16c7ce5
File tree 3 files changed +5
-13
lines changed
3 files changed +5
-13
lines changed Original file line number Diff line number Diff line change 7
7
)
8
8
9
9
const (
10
- Version string = "0.7.2 "
10
+ Version string = "0.7.3 "
11
11
)
12
12
13
13
var VersionCmd = & cobra.Command {
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ import (
10
10
var ReqClient * req.Client
11
11
12
12
var (
13
- dynamicURLRegexp * regexp.Regexp = regexp .MustCompile (`t.bilibili.com/(\d+)|m. bilibili.com/opus/(\d+)` )
13
+ dynamicURLRegexp * regexp.Regexp = regexp .MustCompile (`t.bilibili.com/(\d+)|bilibili.com/opus/(\d+)` )
14
14
numberRegexp * regexp.Regexp = regexp .MustCompile (`\d+` )
15
15
apiURLFormat string = "https://api.bilibili.com/x/polymer/web-dynamic/v1/detail?timezone_offset=-480&platform=web&id=%s&features=itemOpusStyle"
16
16
)
Original file line number Diff line number Diff line change @@ -105,19 +105,11 @@ func GetArtworkMarkdownCaption(artwork *types.Artwork) string {
105
105
caption := fmt .Sprintf ("[*%s*](%s)" , common .EscapeMarkdown (artwork .Title ), artwork .SourceURL )
106
106
caption += "\n " + "*Author:* " + common .EscapeMarkdown (artwork .Artist .Name )
107
107
if artwork .Description != "" {
108
- desc := artwork .Description
109
- lines := strings .Split (desc , "\n " )
110
- for i , line := range lines {
111
- lines [i ] = ">" + common .EscapeMarkdown (line )
112
- if i == len (lines )- 1 {
113
- lines [i ] += "**"
114
- }
115
- }
116
- desc = strings .Join (lines , "\n " )
108
+ desc := strings .ReplaceAll (artwork .Description , "\n " , " " )
117
109
if len (desc ) > 500 {
118
- caption += "\n \n " + desc [: 500 ] + "\\ .\\ .\\ ."
110
+ caption += "\n \n > " + common . EscapeMarkdown ( desc ) + "\\ .\\ .\\ ."
119
111
} else {
120
- caption += "\n \n " + desc
112
+ caption += "\n \n > " + common . EscapeMarkdown ( desc )
121
113
}
122
114
}
123
115
tags := ""
You can’t perform that action at this time.
0 commit comments