From 7dfa7cc09c8939fc709fb894ebd9ee3260071f13 Mon Sep 17 00:00:00 2001 From: Felix Penzlin Date: Fri, 6 Oct 2023 16:47:38 +0200 Subject: [PATCH 1/2] except leading xml declaration --- lib/phoenix_svg.ex | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/phoenix_svg.ex b/lib/phoenix_svg.ex index f39e3f7..6399a24 100644 --- a/lib/phoenix_svg.ex +++ b/lib/phoenix_svg.ex @@ -92,6 +92,11 @@ defmodule PhoenixSVG do """ end + def render("" <> tail, attributes, assigns) do + render(String.trim(tail), attributes, assigns) + end + + @doc """ Renders an inline SVG using a cached file. From ee2a349d442cbfd98a61693cfe3dc05eca30b1dc Mon Sep 17 00:00:00 2001 From: Felix Penzlin Date: Fri, 6 Oct 2023 16:51:44 +0200 Subject: [PATCH 2/2] escape double quotes --- lib/phoenix_svg.ex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/phoenix_svg.ex b/lib/phoenix_svg.ex index 6399a24..bea951c 100644 --- a/lib/phoenix_svg.ex +++ b/lib/phoenix_svg.ex @@ -92,7 +92,7 @@ defmodule PhoenixSVG do """ end - def render("" <> tail, attributes, assigns) do + def render("" <> tail, attributes, assigns) do render(String.trim(tail), attributes, assigns) end