|
|
@@ -4,8 +4,15 @@ defmodule CvGenView.Text do
|
|
|
attr(:text, :any, required: true)
|
|
|
attr(:rest, :global)
|
|
|
|
|
|
- def text(assigns),
|
|
|
+ def text(assigns) when is_binary(assigns.text),
|
|
|
do: ~H"""
|
|
|
<p {@rest}><%= @text %></p>
|
|
|
"""
|
|
|
+
|
|
|
+ def text(assigns) when is_list(assigns.text),
|
|
|
+ do: ~H"""
|
|
|
+ <%= for paragraph <- @text do %>
|
|
|
+ <p {@rest}><%= paragraph %></p>
|
|
|
+ <% end %>
|
|
|
+ """
|
|
|
end
|