+ def render_content(%{"type" => object_type} = object)
+ when object_type in ["Article", "Page"] do
+ with summary when not is_nil(summary) and summary != "" <- object["name"],
+ url when is_bitstring(url) <- object["url"] do
+ "<p><a href=\"#{url}\">#{summary}</a></p>#{object["content"]}"
+ else
+ _ -> object["content"] || ""
+ end
+ end
+
+ def render_content(object), do: object["content"] || ""
+
+ @doc """
+ Builds a dictionary tags.
+
+ ## Examples
+
+ iex> Pleroma.Web.MastodonAPI.StatusView.build_tags(["fediverse", "nextcloud"])
+ [{"name": "fediverse", "url": "/tag/fediverse"},
+ {"name": "nextcloud", "url": "/tag/nextcloud"}]