// tok should be the output of htmlcoarsetok
static L dropAllTags(L tok) {
new L list;
for (int i = 1; i < tok.size(); i += 2) {
S t = tok.get(i);
if (t.startsWith("<")) {
list.set(list.size()-1, list.get(list.size()-1) + tok.get(i+1));
++i;
} else
list.add(tok.get(i));
}
return list;
}
// alternatively, call this convenient function
static S dropAllTags(S html) {
return join(dropAllTags(htmlcoarsetok(html)));
}