diff options
author | Bjørn Erik Pedersen <[email protected]> | 2021-05-19 03:45:36 +0200 |
---|---|---|
committer | Bjørn Erik Pedersen <[email protected]> | 2021-05-19 03:45:36 +0200 |
commit | dc6b7a75ff5b7fcb8a0b0e3f7ed406422d847624 (patch) | |
tree | f567d55d5ba900a488d777cb5fb979f414d2e061 /common/text | |
parent | 3f515f0e3395b24776ae24045b846ff2b33b8906 (diff) | |
download | hugo-dc6b7a75ff5b7fcb8a0b0e3f7ed406422d847624.tar.gz hugo-dc6b7a75ff5b7fcb8a0b0e3f7ed406422d847624.zip |
Revert "publisher: Make the HTML element collector more robust"
This reverts commit ef0f1a726901d6c614040cfc2d7e8f9a2ca97816.
Diffstat (limited to 'common/text')
-rw-r--r-- | common/text/transform.go | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/common/text/transform.go b/common/text/transform.go index 2d51f6c33..f59577803 100644 --- a/common/text/transform.go +++ b/common/text/transform.go @@ -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 -} |