public static final int discardSaveAndChange = 19;
public static final int saveAndChange = 20;
public static final int change = 21;
+ public static final int writeAsWS = 22;
public static final int inSkipping = 0;
public static final int inSTag = 1;
if (buffer.read() != '-') continue; // not "<!--"
- char[] lastthree = new char[3];
- int pos = 0;
- while(true) {
- currentChar = buffer.read();
- lastthree[pos] = (char)currentChar;
- if (lastthree[pos] == '>' && lastthree[(pos + 2) % 3] == '-' && lastthree[(pos + 1) % 3] == '-') break;
- pos = (pos + 1) % 3;
- }
-
- state = operands[inCharData];
+ state = operands[inComment];
continue; // change state to operand
case endComment:
// deal with the case where we might have "------->"
while ((currentChar = buffer.read()) == '-');
- if (currentChar == '>') break; // end of comment, change state to operand
+ if (currentChar == '>') {
+ state = operands[inCharData];
+ }
}
continue; // not end of comment, don't change state
buffer.write(currentChar);
break; // change state to operand
+ case writeAsWS:
+ buffer.write((currentChar == '\n' ? currentChar : (char)32));
+ break;
+
case discardAndChange:
// throw saved characters away and change state
"\u0a15\u110f\u110f\u110e\u110f\u110f\u110f\u110f\u110f\u110f\u110f\u110f\u110f\u1811\u110f",
"\u1d11\u1d11\u1d11\u1d11\u1d11\u1d11\u1d11\u1d11\u1d11\u130c\u1d11\u1408\u1d11\u1811\u1515",
"\u130f\u130f\u130f\u130f\u130f\u130f\u130f\u130f\u130f\u130f\u110d\u130f\u130f\u1811\u130f",
- "\u1415\u1415\u1415\u1415\u1415\u1415\u1415\u1415\u1415\u1415\u1415\u0009\u1415\u1811\u1415",
+ "\u1416\u1416\u1416\u1416\u1416\u1416\u1416\u1416\u1416\u1416\u1416\u0009\u1416\u1811\u1416",
+// "\u1415\u1415\u1415\u1415\u1415\u1415\u1415\u1415\u1415\u1415\u1415\u0009\u1415\u1811\u1415",
"\u150a\u000b\u1515\u1515\u1515\u1515\u1515\u1515\u1515\u1515\u1515\u1515\u1515\u1811\u1515",
"expected Element",
"unexpected character in tag",