fix(serialize-xml): Don't require ending semicolon of reference when lenient in NativeXmlReader
ci/woodpecker/push/woodpecker Pipeline was successful
Details
ci/woodpecker/push/woodpecker Pipeline was successful
Details
This commit is contained in:
parent
ca746c05a4
commit
12aec5bfda
|
@ -378,14 +378,18 @@ public class NativeXmlReader implements Closeable {
|
||||||
// read the entity reference
|
// read the entity reference
|
||||||
// we don't support these, so just handle them like a normal string
|
// we don't support these, so just handle them like a normal string
|
||||||
String result = nextName();
|
String result = nextName();
|
||||||
if (buffer[pos] != ';') throw syntaxError("Missing ';' in entity reference");
|
if (buffer[pos] != ';') {
|
||||||
pos++;
|
if (!lenient) throw syntaxError("Missing ';' in entity reference");
|
||||||
if (result.equals("apos")) return "'";
|
return "&" + result;
|
||||||
if (result.equals("quot")) return "\"";
|
} else {
|
||||||
if (result.equals("amp")) return "&";
|
pos++;
|
||||||
if (result.equals("lt")) return "<";
|
if (result.equals("apos")) return "'";
|
||||||
if (result.equals("gt")) return ">";
|
if (result.equals("quot")) return "\"";
|
||||||
return "&" + result + ";";
|
if (result.equals("amp")) return "&";
|
||||||
|
if (result.equals("lt")) return "<";
|
||||||
|
if (result.equals("gt")) return ">";
|
||||||
|
return "&" + result + ";";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue