private static void ReadCloseElement(ParserContext context)
		{
			var match = RxReadCloseAttribute.Match(context.Html, context.Index);
			if(!match.Success)
			{
				var str = context.Html.Substring(context.Index);
				context.Tokens.Add(new HtmlParserToken { Type = TokenType.Text, A = context.AdjustForWhitespace(str), Raw = str });
				context.Index = context.Html.Length;
			}
			else
			{
				var newToken = new HtmlParserToken { Type = TokenType.CloseElement, Raw = match.Value, A = match.Groups["name"].Value };
				context.Tokens.Add(newToken);
				//HACK there might be a tag inside of a tag (Incorrectly closed tag) like </strong</td>
				//If we find this, we are going to adjust
				if (newToken.A.IndexOf("<") > -1)
				{
					var index = match.Value.Substring(2).IndexOf("<");
					newToken.A = newToken.A.Substring(0, index);
					context.Index += index + 2;
				}
				else
				{
					context.Index += match.Length;
				}
			}
		}
		private static void ReadElement(ParserContext context)
		{
			var start = context.Index;
			context.Index++;
			var match = RxReadTagName.Match(context.Html, context.Index);
			context.Index += match.Length;
			var elementToken = new HtmlParserToken { Type = TokenType.Element, A = match.Value };
			if(match.Value.ToLowerInvariant() == "script")
				context.InScriptTag = true;
			context.Tokens.Add(elementToken);

			while(!context.EndOfString)
			{
				// read whitespace before an attribute name
				SkipWhiteSpace(context);

				if(!context.EndOfString && RxReadAttribute.IsMatch(context.CharAtIndex.ToString()))
				{
					var attrMatch = RxReadAttribute.Match(context.Html, context.Index);
					var token = new HtmlParserToken { Type = TokenType.Attribute, A = attrMatch.Groups["name"].Value, Raw = attrMatch.Value };
					var valgrp = attrMatch.Groups["value"];
					if(valgrp.Success)
						token.B = valgrp.Value;
					context.Tokens.Add(token);
					context.Index += attrMatch.Length;
				}
				else
				{
					if(context.Index < context.Html.Length - 1 && context.Html.Substring(context.Index, 2) == "/>")
					{
						context.Index += 2;
						break;
					}
					var ch = context.CharAtIndex;
					if(ch != '<')
						context.Index++;
					if(ch == '>' || ch == '<')
						break;
				}
			}

			elementToken.Raw = context.Html.Substring(start, context.Index - start);
		}