Skip to content

Commit 33cc976

Browse files
committed
Allow adding links to images in Markdown campaigns
1 parent ae9bd05 commit 33cc976

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
## Unreleased
44

5+
### Fixed
6+
- Markdown campaigns now allow adding links to images
7+
8+
59
## Version 0.12.6
610

711
### Fixed

lib/keila/templates/html.ex

+25
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,31 @@ defmodule Keila.Templates.Html do
210210
]}
211211
end
212212

213+
defp do_apply_email_markup(
214+
{"a", a_attrs, [{"table", _, [{"tr", _, [{"td", _, [{img, img_attrs, _}]}]}]}]}
215+
) do
216+
{"table", [{"style", "width: 100%"}],
217+
[
218+
{"tr", [{"class", "block--image"}],
219+
[
220+
{"td", [],
221+
[
222+
{"a", a_attrs,
223+
[
224+
{"img",
225+
img_attrs ++
226+
[
227+
{"width", "100%"},
228+
{"style",
229+
"display:block; max-width:100%!important; height: auto!important;"},
230+
{"class", "g-img"}
231+
], []}
232+
]}
233+
]}
234+
]}
235+
]}
236+
end
237+
213238
defp do_apply_email_markup({"img", img_attrs, _}) do
214239
{"table", [{"style", "width: 100%"}],
215240
[

0 commit comments

Comments
 (0)