AngleSharp by Florian Rappl

<PackageReference Include="AngleSharp" Version="0.8.0" />

 HtmlParserExtensions

static class HtmlParserExtensions
Extensions to be used exclusively by the parser.
public static void AddComment(this Node parent, HtmlToken token)

Appends a comment node to the specified node.

public static void AddFormatting(this List<Element> formatting, Element element)

Adds an element to the list of active formatting elements.

public static void AddScopeMarker(this List<Element> formatting)

Inserts a scope marker at the end of the list of active formatting elements.

public static void ClearFormatting(this List<Element> formatting)

Clear the list of active formatting elements up to the last marker.

public static bool IsTableElement(this INode node)

Examines if the given element is one of the table elements (table, tbody, tfoot, thead, tr).

public static void SetAttributes(this Element element, List<KeyValuePair<string, string>> attributes)

Adds all given attributes to the element, without any duplicate checks.

public static void SetUniqueAttributes(this Element element, List<KeyValuePair<string, string>> attributes)

Sanatizes the given list by removing the duplicates first, then calls the SetAttributes method to add the remaining attributes to the element.