Sablon.Configuration.HTMLTag (sablon v0.4.3)

Copy Markdown View Source

The conversion rules for a single HTML tag.

An optional :ast_class decides how the element is converted; when it is omitted the tag is "passed through", only handing its properties down to its children. Block level tags must define an AST class. The block/inline status of a tag is fixed and never affected by CSS.

Summary

Functions

Returns true when tag may appear as a child of this tag.

Types

t()

@type t() :: %Sablon.Configuration.HTMLTag{
  allowed_children: [atom()],
  ast_class: module() | nil,
  attributes: map(),
  name: atom(),
  properties: Sablon.Props.t(),
  type: :inline | :block
}

Functions

allowed_child?(html_tag, tag)

@spec allowed_child?(t(), t()) :: boolean()

Returns true when tag may appear as a child of this tag.

new(name, type \\ :inline, options \\ [])

@spec new(atom() | binary(), :inline | :block, keyword()) :: t()

Builds a tag definition.

Options: :ast_class (module or a snake-cased atom naming a class under Sablon.HTMLConverter), :properties, :attributes and :allowed_children.