Attribute generation and escaping for Phlex components.
Handles attribute name normalization, value escaping, and security validation aligned with Phlex Ruby 2.4.1.
Summary
Functions
Decodes HTML character references used to obfuscate javascript: URLs.
Generates HTML attributes from a keyword list or map.
Functions
Decodes HTML character references used to obfuscate javascript: URLs.
Generates HTML attributes from a keyword list or map.
Examples
iex> Phlex.SGML.Attributes.generate_attributes([class: "foo", id: "bar"])
" class=\"foo\" id=\"bar\""
iex> Phlex.SGML.Attributes.generate_attributes([disabled: true])
" disabled"
iex> Phlex.SGML.Attributes.generate_attributes([style: [color: "red", padding: "10px"]])
" style=\"color: red; padding: 10px;\""