Revert "publisher: Make the HTML element collector more robust"

This reverts commit ef0f1a7269.
This commit is contained in:
Bjørn Erik Pedersen
2021-05-19 03:45:36 +02:00
parent 3f515f0e33
commit dc6b7a75ff
3 changed files with 169 additions and 302 deletions

View File

@@ -45,25 +45,3 @@ func RemoveAccentsString(s string) string {
accentTransformerPool.Put(t)
return s
}
// Chunk splits s into strings of size.
func Chunk(s string, size int) []string {
if size >= len(s) {
return []string{s}
}
var chunks []string
chunk := make([]rune, size)
l := 0
for _, r := range s {
chunk[l] = r
l++
if l == size {
chunks = append(chunks, string(chunk))
l = 0
}
}
if l > 0 {
chunks = append(chunks, string(chunk[:l]))
}
return chunks
}