{
if (type == TypeToken.COMMENT)
name = Name.COMMENT;
else
name = Name.CONTENT;
push(new NodeImpl(value, name));
return end;
}
if (value[0] == SpecChar.END_TAG)
{
if (value.length <= 1)
return end;
value = CharsUtil.cutAndTrim(value, 1, value.length);
name = HTML.getName(new String(value).toUpperCase());
if (name != null)
{
push(new NodeImpl(value, name, TypeToken.CLOSE));
}
else
{
char[] newValue = new char[value.length + 1];
newValue[0] = SpecChar.END_TAG;
System.arraycopy(value, 0, newValue, 1, value.length);
push(new NodeImpl(newValue, Name.UNKNOWN));
return end;
}
return end;
}
String nameValue = new String(CharsUtil.cutBySpace(value, 0)).toUpperCase();
if (nameValue.charAt(nameValue.length() - 1) == SpecChar.END_TAG)
{
nameValue = nameValue.substring(0, nameValue.length() - 1).trim();
}
if (nameValue.equals("!DOCTYPE"))
return end;
name = HTML.getName(nameValue);
if (name != null)
{
push(new NodeImpl(value, name, TypeToken.TAG));
}
else
{
push(new NodeImpl(value, Name.UNKNOWN));
return end;
}
if (name == Name.SCRIPT)
{
return findEndScript(data, script, end);