HtmlParser.Parse throws InvalidOperationException on some HTML inputs. Here's the full program to reproduce one such case:
using AngleSharp.Parser.Html;namespace AngleSharp.Run
{publicclassProgram{publicstaticvoidMain(string[]args){stringhtml=@"<svg><!DOCTYPE html><<template>html><desc><template>><p>p</p></body></html>";new HtmlParser().Parse(html);}}}
And here is the stack trace:
An unhandled exception of type 'System.InvalidOperationException' occurred in System.Collections.dll: 'Stack empty.'
at System.Collections.Generic.Stack`1.ThrowForEmptyStack()
at System.Collections.Generic.Stack`1.Peek()
at AngleSharp.Parser.Html.HtmlParserExtensions.SelectMode(Element element, Boolean isLast, Stack`1 templateModes)
at AngleSharp.Parser.Html.HtmlDomBuilder.Reset()
at AngleSharp.Parser.Html.HtmlDomBuilder.InTemplate(HtmlToken token)
at AngleSharp.Parser.Html.HtmlDomBuilder.InBody(HtmlToken token)
at AngleSharp.Parser.Html.HtmlDomBuilder.Parse(HtmlParserOptions options)
at AngleSharp.Run.Program.Main(String[] args) in
HtmlParser.Parse throws InvalidOperationException on some HTML inputs. Here's the full program to reproduce one such case:
And here is the stack trace:
Found via SharpFuzz.
The text was updated successfully, but these errors were encountered: