View Source Mobilizon.Service.Metadata.Utils (Mobilizon v5.0.0-beta.1)

Tools to convert tags to string.

Summary

Functions

Link to this function

datetime_to_string(datetime, locale \\ "en", format \\ :medium)

View Source

See Mobilizon.Service.DateTime.datetime_to_string/3.

Link to this function

default_description(locale \\ "en")

View Source
@spec default_description(String.t()) :: String.t()

Returns the default description for a text

@spec escape_text(String.t()) :: String.t()
Link to this function

process_description(description, locale \\ "en", limit \\ 200)

View Source
@spec process_description(String.t(), String.t(), integer() | nil) :: String.t()

Processes a text and limits it.

  • Removes the HTML tags from a text
  • Slices it to a limit and add an ellipsis character
  • Returns a default description if text is empty
Link to this function

render_address!(address)

View Source

See Mobilizon.Service.Address.render_address!/1.

@spec stringify_tags([Phoenix.HTML.safe() | String.t()]) :: String.t()

Converts list of tags, containing either Phoenix.HTML.safe/0 or strings, to a concatenated string listing the tags

@spec strip_tags(String.t()) :: String.t()

Removes the HTML tags from a text