AngleSharp by Florian Rappl

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

 HtmlParserExtensions

static class HtmlParserExtensions
Extensions to be used exclusively by the parser or the tokenizer.
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 int GetCode(this HtmlParseError code)

Retrieves a number describing the error of a given error code.

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.