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

Summary

Functions

Splits template markup into a list of tokens.

Types

token()

@type token() :: {:string | :symbol | :whitespace, String.t()}

Functions

tokenize(markup)

@spec tokenize(String.t()) :: [token()]

Splits template markup into a list of tokens.

Examples

iex> tokenize("<span>aaa bbb</span>")
[
  symbol: "<",
  string: "span",
  symbol: ">",
  string: "aaa",
  whitespace: " ",
  string: "bbb",
  symbol: "</",
  string: "span",
  symbol: ">"
]