static L<IntRange> charRangesOfHTMLComments(S html) { ret charRangesOfHTMLComments(htmlTok(html)); } static L<IntRange> charRangesOfHTMLComments(LS tok) { new L<IntRange> l; int pos = 0; for idx over tok: { S t = tok.get(idx); if (even(idx)) { int i = 0; while ((i = indexOf(t, "<!--", i)) >= 0) { int j = smartIndexOf(t, "-->", i+4); l.add(intRange(pos+i, pos+j+3)); i = j+3; } } pos += l(t); } ret l; }