AngleSharp.XPath
AngleSharp.XPath copied to clipboard
SelectSingleNode() doesn't select <tr>
In the provided code snippet, the SelectSingleNode() method is expected to return an instance of INode for the selected <tr> element within the HTML content. However, the method is returning null, which indicates a potential bug in the library.
Repro
var context = BrowsingContext.New(Configuration.Default);
var parser = context.GetService<IHtmlParser>();
var document = await parser.ParseDocumentAsync("<table><tr></tr></table>");
var trNode = document.Body.SelectSingleNode("//table/tr");
Actual Result
trNode is null
Expected Result
trNode is not null
Environment
.csproj
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="AngleSharp" Version="1.1.2" />
<PackageReference Include="AngleSharp.XPath" Version="2.0.4" />
</ItemGroup>