mirror of
https://gitcode.com/gitea/gitea.git
synced 2025-05-24 18:46:12 +08:00
enable staticcheck QFxxxx rules (#34064)
This commit is contained in:
@ -14,13 +14,14 @@ import (
|
||||
// token is a html tag or entity, eg: "<span ...>", "</span>", "<"
|
||||
func extractHTMLToken(s string) (before, token, after string, valid bool) {
|
||||
for pos1 := 0; pos1 < len(s); pos1++ {
|
||||
if s[pos1] == '<' {
|
||||
switch s[pos1] {
|
||||
case '<':
|
||||
pos2 := strings.IndexByte(s[pos1:], '>')
|
||||
if pos2 == -1 {
|
||||
return "", "", s, false
|
||||
}
|
||||
return s[:pos1], s[pos1 : pos1+pos2+1], s[pos1+pos2+1:], true
|
||||
} else if s[pos1] == '&' {
|
||||
case '&':
|
||||
pos2 := strings.IndexByte(s[pos1:], ';')
|
||||
if pos2 == -1 {
|
||||
return "", "", s, false
|
||||
|
Reference in New Issue
Block a user