ratchet v0.1.0 Ratchet.Data

Summary

Functions

Extract attributes from a data property

Extract content from a data property

Functions

attributes(arg1, elem_attrs)

Extract attributes from a data property

iex> Data.attributes({"", href: "https://google.com", rel: "nofollow"}, [])
~S(href="https://google.com" rel="nofollow")
iex> Data.attributes("lolwat", [{"data-prop", "joke"}])
~S(data-prop="joke")
content(text)

Extract content from a data property

iex> Data.content("text")
"text"
iex> Data.content({"text", []})
"text"