Render URLs as links when listing items from a map
This commit is contained in:
parent
b8da973a81
commit
4999884f7d
1 changed files with 7 additions and 1 deletions
|
|
@ -644,7 +644,13 @@ defmodule PinchflatWeb.CoreComponents do
|
||||||
<li :for={{k, v} <- @iterable_attributes} class="mb-2 w-2/3">
|
<li :for={{k, v} <- @iterable_attributes} class="mb-2 w-2/3">
|
||||||
<strong><%= k %>:</strong>
|
<strong><%= k %>:</strong>
|
||||||
<code class="inline-block text-sm font-mono text-gray p-0.5 mx-0.5">
|
<code class="inline-block text-sm font-mono text-gray p-0.5 mx-0.5">
|
||||||
<%= v %>
|
<%= if is_binary(v) and String.starts_with?(v, "http") do %>
|
||||||
|
<.link class="underline decoration-bodydark decoration-1 hover:decoration-white" href={v} target="_blank">
|
||||||
|
<%= v %>
|
||||||
|
</.link>
|
||||||
|
<% else %>
|
||||||
|
<%= v %>
|
||||||
|
<% end %>
|
||||||
</code>
|
</code>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue