function parseTagName(tagContent) {
    var state = STATE_START_TAG;
    var tagName = '';
    var index = 0;

    while (state !== STATE_DONE) {
      var char = tagContent[index++].toLowerCase();

      switch (char) {
        case '<':
          break;

        case '>':
          state = STATE_DONE;
          break;

        default:
          if (REGEXP_WHITESPACE.test(char)) {
            if (state === STATE_NON_WHITESPACE) {
              state = STATE_DONE;
            }
          } else {
            if (state === STATE_START_TAG) {
              state = STATE_NON_WHITESPACE;
            }

            if (char !== '/') {
              tagName += char;
            }
          }

          break;
      }
    }

    return tagName;
  }
Parses the tag name from html content.

@ignore
@param {string} tagContent The tag content.
@return {string} Returns the tag name.