Commit Graph
4 Commits
Author SHA1 Message Date
dualfroz d6450709f9 fix: remove every occurrence of a repeated class
RemoveClass deleted each class with one strings.ReplaceAll pass over the
space-wrapped class list. Two adjacent occurrences share the space
between them, so " a a " holds only one non-overlapping " a " and the
second survived: RemoveClass("a") on class="a a" returned with
HasClass("a") still true. ToggleClass used the same expression and so
toggled such a class the wrong way.

Replace one occurrence at a time, re-scanning from the start, in a helper
shared by both call sites. Whitespace between the remaining classes is
untouched.
2026-09-06 00:44:19 +02:00
upstream d024a0aa26 Upstream PuerkitoBio/goquery state of the touched files before b4ef68dec8 2026-09-04 07:52:26 +02:00
dualfroz 048bc98ddf fix: remove every occurrence of a repeated class
RemoveClass deleted each class with one strings.ReplaceAll pass over the
space-wrapped class list. Two adjacent occurrences share the space
between them, so " a a " holds only one non-overlapping " a " and the
second survived: RemoveClass("a") on class="a a" returned with
HasClass("a") still true. ToggleClass used the same expression and so
toggled such a class the wrong way.

Replace one occurrence at a time, re-scanning from the start, in a helper
shared by both call sites. Whitespace between the remaining classes is
untouched.
2026-09-04 07:52:26 +02:00
upstream 445cd7eabe Upstream PuerkitoBio/goquery state of the touched files before 0f91a3810f 2026-09-04 07:52:26 +02:00