Merge pull request #506 from lmckenzi/Better-handling-of-bad-xhtml-entity

If there's an ampersand that doesn't actually have a closing semi-col…
This commit is contained in:
Grahame Grieve 2021-05-31 08:39:57 +10:00 committed by GitHub
commit f83a4d95e8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 0 deletions

View File

@ -885,6 +885,8 @@ private boolean elementIsOk(String name) throws FHIRFormatError {
// UInt16 w;
readChar();
String c = readUntil(";&'\"><");
if (c.isEmpty())
throw new FHIRFormatError("Invalid literal declaration following text: " + s);
if (c.equals("apos"))
s.append('\'');
else if (c.equals("quot"))