*/
public class HTML {
- // FIXME: fill in
- private final static String[] bodylessTags = new String[] { "br", "hr", "input", "img", "isindex" };
+ private final static String[] noEndTag =
+ new String[] { "area", "base", "basefont", "br", "col", "frame", "hr", "img",
+ "input", "isindex", "link", "meta", "param" };
/** we keep a char[] around for use by removeRedundantWhitespace() */
private static char[] cbuf = null;
while(Character.isSpace(cs.peek())) cs.get();
String elementName = parseElementName(cs);
- // FIXME: this might not deal correctly with EOFExceptions
boolean saveWithinLI = withinLI;
if (elementName.equals("li")) {
if (withinLI) {
cs.get();
// bodyless tags return here
- for(int i=0; i<bodylessTags.length; i++)
- if (bodylessTags[i].equals(elementName))
+ for(int i=0; i<noEndTag.length; i++)
+ if (noEndTag[i].equals(elementName))
return null;
// scan body
sb.append("\"");
i = nextamp + 6;
} else if (s.regionMatches(nextamp, " ", 0, 6)) {
- // FIXME: should have a way to indicate this...
+ // FEATURE: perhaps we should distinguish this somehow
sb.append(" ");
i = nextamp + 6;
} else {
return sb.toString();
}
- // FIXME double check this
/** removes all redundant whitespace */
private static String removeRedundantWhitespace(String s) {