mirror of
https://github.com/Threnklyn/jira.git
synced 2026-06-07 13:33:32 +02:00
[#159] fix slice bounds out of range error in abbrev template function
This commit is contained in:
@@ -158,7 +158,7 @@ func TemplateProcessor() *template.Template {
|
|||||||
return strings.Join(vals, sep)
|
return strings.Join(vals, sep)
|
||||||
},
|
},
|
||||||
"abbrev": func(max int, content string) string {
|
"abbrev": func(max int, content string) string {
|
||||||
if len(content) > max {
|
if len(content) > max && max > 2 {
|
||||||
var buffer bytes.Buffer
|
var buffer bytes.Buffer
|
||||||
buffer.WriteString(content[:max-3])
|
buffer.WriteString(content[:max-3])
|
||||||
buffer.WriteString("...")
|
buffer.WriteString("...")
|
||||||
|
|||||||
Reference in New Issue
Block a user