code: protected void entity() {
          nextChar();
          String name = null;
          if (ch == '#') {
              int namep = bp;
              nextChar();
              if (isDecimalDigit(ch)) {
                  nextChar();
                  while (isDecimalDigit(ch))
                      nextChar();
                  name = new String(buf, namep, bp - namep);
              } else if (ch == 'x' || ch == 'X') {
                  nextChar();
                  if (isHexDigit(ch)) {
                      nextChar();
                      while (isHexDigit(ch))
                          nextChar();
                      name = new String(buf, namep, bp - namep);
                  }
              }
          } else if (isIdentifierStart(ch)) {
              name = readIdentifier();
          }
  
          if (name != null) {
              if (ch != ';')
                  return;
              nextChar();
          }
      }
docs: Read an HTML entity.
  {@literal &identifier; } or {@literal &#digits; } or {@literal &#xhex-digits; }