sS cleanSkypeMsg(S content) {
LS tok = htmlTok(content);
new StringBuilder out;
for (int i = 0; i < l(tok); i++) {
ifdef cleanSkypeMsg_debug printVars(+i, t := tok.get(i)); endifdef
if (odd(i)) {
S tag = getTag(tok.get(i));
ifdef cleanSkypeMsg_debug printVars(+i, +tag); endifdef
if (!startsWith(tag, "/") && !eqicOneOf(tag, "b", "i", "at")) {
// skip any other tags
if (eqic(tag, "ss")) out.append(":" + tagParam(tok.get(i), "type") + ":");
int j = findEndOfContainerTag(tok, i);
i = j < 0 ? l(tok) : j-1;
}
ifdef cleanSkypeMsg_debug printVars(+i); endifdef
} else
out.append(htmlDecode(tok.get(i)));
}
ret str(out);
}