/// <summary> /// See 8.2.4.62 After DOCTYPE system keyword state /// </summary> public void ParseSystem(HtmlLexer lexer) { PropertyTextReader.SkipSpaces(lexer); char c = lexer.Peek(); if (c == '"' || c == '\'') { systemId = ReadQuotedString(lexer); SystemIdentifierAfter(lexer); } else if (c == '>') { lexer.Read(); lexer.State = HtmlParseMode.PCData; quirksMode = true; } else if (c == '\0') { quirksMode = true; } else { lexer.Read(); quirksMode = true; ParseBroken(lexer); } }
/// <summary> /// See 8.2.4.56 After DOCTYPE public keyword state /// </summary> internal void ParsePublic(HtmlLexer lexer) { PropertyTextReader.SkipSpaces(lexer); char c = lexer.Peek(); if (c == '"' || c == '\'') { publicId = ReadQuotedString(lexer); PublicIdentifierAfter(lexer); } else if (c == '>') { lexer.Position++; lexer.State = HtmlParseMode.PCData; quirksMode = true; } else if (c == '\0') { quirksMode = true; } else { lexer.Position++; quirksMode = true; ParseBroken(lexer); } }
/// <summary> /// See 8.2.4.61 Between DOCTYPE public and system identifiers state /// </summary> private void DoctypeBetween(HtmlLexer lexer) { PropertyTextReader.SkipSpaces(lexer); char c = lexer.Peek(); if (c == '>') { lexer.Position++; lexer.State = HtmlParseMode.PCData; } else if (c == '"' || c == '\'') { systemId = ReadQuotedString(lexer); SystemIdentifierAfter(lexer); } else if (c == '\0') { quirksMode = true; } else { quirksMode = true; ParseBroken(lexer); } }
/// <summary>reads a "quoted" or 'quoted' string.</summary> private string ReadQuotedString(HtmlLexer lexer) { PropertyTextReader.ReadString(lexer, lexer.Builder); string str = lexer.Builder.ToString(); lexer.Builder.Length = 0; return(str); }
/// <summary> /// See 8.2.4.66 After DOCTYPE system identifier state /// </summary> private void SystemIdentifierAfter(HtmlLexer lexer) { PropertyTextReader.SkipSpaces(lexer); char c = lexer.Peek(); if (c == '>') { lexer.Position++; lexer.State = HtmlParseMode.PCData; } else if (c == '\0') { quirksMode = true; } else { ParseBroken(lexer); } }