InvalidOperationException: Stack empty in AngleSharp.Html.Parser.HtmlDomBuilder
mschessler opened this issue · 1 comments
Prerequisites
- Can you reproduce the problem in a MWE?
- Are you running the latest version of AngleSharp?
- Did you check the FAQs to see if that helps you?
- Are you reporting to the correct repository? (there are multiple AngleSharp libraries, e.g.,
AngleSharp.Css
for CSS support) - Did you perform a search in the issues?
Description
System.InvalidOperationException: Stack empty.
at System.Collections.Generic.Stack1.ThrowForEmptyStack() at System.Collections.Generic.Stack
1.Pop()
at AngleSharp.Html.Parser.HtmlDomBuilder2.CloseTemplateMode() at AngleSharp.Html.Parser.HtmlDomBuilder
2.CloseTemplate()
at AngleSharp.Html.Parser.HtmlDomBuilder2.InHead(StructHtmlToken& token) at AngleSharp.Html.Parser.HtmlDomBuilder
2.InBodyEndTag(StructHtmlToken& tag)
at AngleSharp.Html.Parser.HtmlDomBuilder2.InBody(StructHtmlToken& token) at AngleSharp.Html.Parser.HtmlDomBuilder
2.Home(StructHtmlToken& token)
at AngleSharp.Html.Parser.HtmlDomBuilder2.Consume(StructHtmlToken& token) at AngleSharp.Html.Parser.HtmlDomBuilder
2.Parse(HtmlParserOptions options, TokenizerMiddleware middleware)
at AngleSharp.Html.Parser.HtmlParser.Parse(HtmlDocument document, String stopAt)
at AngleSharp.Html.Parser.HtmlParser.ParseDocument(Char[] source, Int32 length)
Steps to Reproduce
var html = "<svg><template><title><v></temPlate>";
var parser = new AngleSharp.Html.Parser.HtmlParser();
parser.ParseDocument(html.ToCharArray(), 0);
Expected Behavior
Don't crash
Actual Behavior
Crash
Possible Solution / Known Workarounds
No response
Thanks! Fixed in latest preview.