Refactor og:description
to limit the max length (#26876)
1. The `og:description` should be "a one to two sentence description of your object" * It shouldn't output all the user inputted content -- it would be pretty huge. * Maybe it only needs at most 300 bytes. 2. Do not render commit message as HTML
This commit is contained in:
parent
9a3de436f4
commit
c802c46a9b
2 changed files with 15 additions and 5 deletions
|
@ -33,6 +33,11 @@ func (su *StringUtils) Join(a []string, sep string) string {
|
|||
return strings.Join(a, sep)
|
||||
}
|
||||
|
||||
func (su *StringUtils) Cut(s, sep string) []any {
|
||||
before, after, found := strings.Cut(s, sep)
|
||||
return []any{before, after, found}
|
||||
}
|
||||
|
||||
func (su *StringUtils) EllipsisString(s string, max int) string {
|
||||
return base.EllipsisString(s, max)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue