Retro v0.2.0 Retro.Phoenix.HTML.Link View Source

Toolkit for extending Phoenix.HTML.Link.

Link to this section Summary

Functions

Generates a external link to the given URL with vulnerability care. Get more details at here.

Link to this section Functions

Link to this function

external_link(text, opts)

View Source (since 0.2.0)

Generates a external link to the given URL with vulnerability care. Get more details at here.

This function is same as Phoenix.HTML.Link.link/2 except that it adds two additional options:

[
  target: "_blank",
  rel: "noopener noreferrer"
]

Examples

iex> external_link("open page", to: "https://example.com") |> Phoenix.HTML.safe_to_string
"<a href=\"https://example.com\" rel=\"noopener noreferrer\" target=\"_blank\">open page</a>"