View Source Hologram.Template.Helpers (hologram v0.2.0)

Summary

Functions

Determines whether the given tag is an element or a component.

Determines whether the given tag name belongs to a void element.

Functions

tag_type(arg)

@spec tag_type(String.t()) :: :component | :element

Determines whether the given tag is an element or a component.

Examples

iex> tag_type("div")
:element

iex> tag_type("MyComponent")
:component

void_element?(tag_name)

@spec void_element?(String.t()) :: boolean()

Determines whether the given tag name belongs to a void element.

Examples

iex> void_element?("br")
true

iex> void_element?("div")
false