Skip to content

LiveToast.put_toast should be able to handle Phoenix.raw() #58

@bu6n

Description

@bu6n

This is something that works with Phoenix's default put_flash:

def handle_event("test_html", _params, socket) do
    {:noreply, put_flash(socket, :info, Phoenix.HTML.raw("<b>bold</b> and <em>italic</em>"))}
  end

Replacing put_flash with LiveToast.put_toast here results in following error:

[error] GenServer #PID<0.11438.0> terminating
** (FunctionClauseError) no function clause matching in Gettext.dpgettext/5
    (gettext 0.26.2) lib/gettext.ex:799: Gettext.dpgettext(LiveToast.Gettext, "live_toast", nil, {:safe, "<b>bold</b> and <em>italic</em>"}, %{})
    (live_toast 0.8.0) lib/live_toast/live_component.ex:110: anonymous fn/4 in LiveToast.LiveComponent.render/1

I can provide a PR if needed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions