Skip to content

Commit

Permalink
fix: ordering of element traversal
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnCampionJr committed Feb 5, 2024
1 parent 562f7e0 commit 4c3fcb3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Converters/Base.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ protected static INode[] TemplateNode(string file, IHtmlDocument doc, string? cl

protected void EachNode(string cssLookup, Action<IElement> action)
{
var nodes = Doc.QuerySelectorAll(cssLookup).Reverse(); //.OrderBy<>(n => n.Ancestors.Count()).Reverse();
var nodes = Doc.QuerySelectorAll(cssLookup).OrderByDescending(x => x.Ancestors().Count());
foreach (var node in nodes)
{
action(node);
Expand Down

0 comments on commit 4c3fcb3

Please sign in to comment.