Skip to content

Commit

Permalink
Allow adding links to images in Markdown campaigns
Browse files Browse the repository at this point in the history
  • Loading branch information
wmnnd committed Oct 30, 2023
1 parent ae9bd05 commit 33cc976
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Unreleased

### Fixed
- Markdown campaigns now allow adding links to images


## Version 0.12.6

### Fixed
Expand Down
25 changes: 25 additions & 0 deletions lib/keila/templates/html.ex
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,31 @@ defmodule Keila.Templates.Html do
]}
end

defp do_apply_email_markup(
{"a", a_attrs, [{"table", _, [{"tr", _, [{"td", _, [{img, img_attrs, _}]}]}]}]}
) do
{"table", [{"style", "width: 100%"}],
[
{"tr", [{"class", "block--image"}],
[
{"td", [],
[
{"a", a_attrs,
[
{"img",
img_attrs ++
[
{"width", "100%"},
{"style",
"display:block; max-width:100%!important; height: auto!important;"},
{"class", "g-img"}
], []}
]}
]}
]}
]}
end

defp do_apply_email_markup({"img", img_attrs, _}) do
{"table", [{"style", "width: 100%"}],
[
Expand Down

0 comments on commit 33cc976

Please sign in to comment.