docs: private MarkToken getToken(final String in, final int pos)
      {
          final char c0 = pos > 0 ? whitespaceToSpace(in.charAt(pos - 1)) : ' ';
          final char c = whitespaceToSpace(in.charAt(pos));
          final char c1 = pos + 1 < in.length() ? whitespaceToSpace(in.charAt(pos + 1)) : ' ';
          final char c2 = pos + 2 < in.length() ? whitespaceToSpace(in.charAt(pos + 2)) : ' ';
          final char c3 = pos + 3 < in.length() ? whitespaceToSpace(in.charAt(pos + 3)) : ' ';
  
          switch (c)
          {
          case '*':
              if (c1 == '*')
              {
                  return c0 != ' ' || c2 != ' ' ? MarkToken.STRONG_STAR : MarkToken.EM_STAR;
              }
              return c0 != ' ' || c1 != ' ' ? MarkToken.EM_STAR : MarkToken.NONE;
          case '_':
              if (c1 == '_')
              {
                  return c0 != ' ' || c2 != ' ' ? MarkToken.STRONG_UNDERSCORE : MarkToken.EM_UNDERSCORE;
              }
              if (this.useExtensions)
              {
                  return Character.isLetterOrDigit(c0) && c0 != '_' && Character.isLetterOrDigit(c1) ? MarkToken.NONE
                          : MarkToken.EM_UNDERSCORE;
              }
              return c0 != ' ' || c1 != ' ' ? MarkToken.EM_UNDERSCORE : MarkToken.NONE;
          case '!':
              if (c1 == '[')
              {
                  return MarkToken.IMAGE;
              }
              return MarkToken.NONE;
          case '[':
              if (this.useExtensions && c1 == '[')
              {
                  return MarkToken.X_LINK_OPEN;
              }
              return MarkToken.LINK;
          case ']':
              if (this.useExtensions && c1 == ']')
              {
                  return MarkToken.X_LINK_CLOSE;
              }
              return MarkToken.NONE;
          case '`':
              return c1 == '`' ? MarkToken.CODE_DOUBLE : MarkToken.CODE_SINGLE;
          case '\\':
              switch (c1)
              {
              case '\\':
              case '[':
              case ']':
              case '(':
              case ')':
              case '{':
              case '}':
              case '#':
              case '"':
              case '\'':
              case '.':
              case '>':
              case '<':
              case '*':
              case '+':
              case '-':
              case '_':
              case '!':
              case '`':
              case '~':
              case '^':
                  return MarkToken.ESCAPE;
              default:
                  return MarkToken.NONE;
              }
          case '<':
              if (this.useExtensions && c1 == '<')
              {
                  return MarkToken.X_LAQUO;
              }
              return MarkToken.HTML;
          case '&':
              return MarkToken.ENTITY;
          default:
              if (this.useExtensions)
              {
                  switch (c)
                  {
                  case '-':
                      if (c1 == '-')
                      {
                          return c2 == '-' ? MarkToken.X_MDASH : MarkToken.X_NDASH;
                      }
                      break;
                  case '^':
                      return c0 == '^' || c1 == '^' ? MarkToken.NONE : MarkToken.SUPER;
                  case '>':
                      if (c1 == '>')
                      {
                          return MarkToken.X_RAQUO;
                      }
                      break;
                  case '.':
                      if (c1 == '.' && c2 == '.')
                      {
                          return MarkToken.X_HELLIP;
                      }
                      break;
                  case '(':
                      if (c1 == 'C' && c2 == ')')
                      {
                          return MarkToken.X_COPY;
                      }
                      if (c1 == 'R' && c2 == ')')
                      {
                          return MarkToken.X_REG;
                      }
                      if (c1 == 'T' & c2 == 'M' & c3 == ')')
                      {
                          return MarkToken.X_TRADE;
                      }
                      break;
                  case '"':
                      if (!Character.isLetterOrDigit(c0) && c1 != ' ')
                      {
                          return MarkToken.X_LDQUO;
                      }
                      if (c0 != ' ' && !Character.isLetterOrDigit(c1))
                      {
                          return MarkToken.X_RDQUO;
                      }
                      break;
                  }
              }
              return MarkToken.NONE;
          }
      }