normalize_attributes
Normalizes a list of attribute name-value pairs by sorting class names alphabetically and standardizing boolean attributes to ensure consistent DOM comparisons.
def normalize_attributes(
attributes: iterable
) - > list
Standardizes HTML attribute values to ensure consistent comparisons between DOM instances, specifically handling class ordering and boolean attribute shorthand.
Parameters
| Name | Type | Description |
|---|---|---|
| attributes | iterable | A collection of name-value pairs representing HTML attributes to be processed. |
Returns
| Type | Description |
|---|---|
list | A list of tuples containing the normalized attribute names and their standardized values. |