Helpers for node attribute lists.
Attributes are an ordered list of {key, value} string pairs. Order and
duplicates are preserved; multiple "class" entries are joined when rendered.
Summary
Functions
Appends a class.
Removes every entry for key.
Returns the value for key.
Replaces every entry for key with a single {key, value} at the end.
Types
Functions
Appends a class.
Removes every entry for key.
Returns the value for key.
For "class", all class values joined with a space. For other keys, the last value.
Returns nil when the key is absent.
iex> Markup.Djot.Attributes.get([{"class", "a"}, {"id", "x"}, {"class", "b"}], "class")
"a b"
iex> Markup.Djot.Attributes.get([{"id", "x"}, {"id", "y"}], "id")
"y"
Replaces every entry for key with a single {key, value} at the end.