mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-10-31 02:46:04 +01:00 
			
		
		
		
	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:
		| @@ -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) | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user