static S htag(S tag) { ret htag(tag, ""); } static S htag(S tag, S contents, O... params) { new StringBuilder buf; buf.append("<" + tag); for (int i = 0; i < l(params); i += 2) { S name = (S) get(params, i); O val = get(params, i+1); if (nempty(name) && val != null) { S s = str(val); if (!empty(s)) buf.append(" " + name + "=" + htmlQuote(s)); } } S s = str(contents); if (empty(s)) buf.append("/>"); else buf.append(">" + s + ""); ret str(buf); } // shortcut for converting an object to string static S htag(S tag, O contents, O... params) { ret htag(tag, str(contents), params); }