You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When trying to parse html that contains an empty list element:
<ul><li>not empty</li><li></li></ul>
an System.InvalidOperationException is thrown.
Stacktrace:
Unhandled exception. System.InvalidOperationException: Sequence contains no elements
at System.Linq.ThrowHelper.ThrowNoElementsException()
at System.Linq.Enumerable.First[TSource](IEnumerable`1 source)
at HtmlToOpenXml.Expressions.ListExpression.<Interpret>d__4.MoveNext()
at HtmlToOpenXml.Expressions.BlockElementExpression.ComposeChildren(ParsingContext context, IEnumerable`1 childNodes, ParagraphProperties paragraphProperties, Action`1 preAction, Action`1 postAction)
at HtmlToOpenXml.Expressions.BlockElementExpression.Interpret(ParsingContext context, IEnumerable`1 childNodes)
at HtmlToOpenXml.Expressions.PhrasingElementExpression.Interpret(ParsingContext context)
at HtmlToOpenXml.Expressions.BlockElementExpression.Interpret(ParsingContext context)
at HtmlToOpenXml.Expressions.BodyExpression.Interpret(ParsingContext context)
at HtmlToOpenXml.HtmlConverter.<Parse>d__8.MoveNext()
at HtmlToOpenXml.HtmlConverter.Parse(String html)
at Program.<Main>$(String[] args) in C:\git\MyApp\MyApp\Program.cs:line 10
Expected behavior
An exception should not be thrown when the html contains an empty list element.
Describe the bug
When trying to parse html that contains an empty list element:
an
System.InvalidOperationException
is thrown.Stacktrace:
Expected behavior
An exception should not be thrown when the html contains an empty list element.
Repro
The text was updated successfully, but these errors were encountered: