You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When using mjml-rails in conjunction with haml, the expected haml behavior of embedding a Ruby link into a line with = resulted in inline HTML instead of a functioning link.
%mj-text
= "Link your Twitter, Slack, and GitHub accounts today. #{link_to 'Set up integrations >', user_settings_url(@user)}"
Expected behavior
The code above should render a working link, correctly formatted, like this:
Resulting behavior
The HTML appears inline in the corresponding view.
Solutions
We were able to get the links working correctly with either == or ! (examples below). We ultimately went with the bang method (!), but neither option successfully bypassed our Prettier checks.
%mj-text
== "Link your Twitter, Slack, and GitHub accounts today. #{link_to 'Set up integrations >', user_settings_url(@user)}"
With the bang method, we're able to prevent interpolation escaping. More info here.
%mj-text
! Link your Twitter, Slack, and GitHub accounts today. #{link_to 'Set up integrations >', user_settings_url(@user)}
We were able to get everything to work by adding the file in question to our Prettier ignore file.
The text was updated successfully, but these errors were encountered:
@alexlsalt Sorry for the huge delay... did you have any suggestions for changes in mjml-rails? I don't use HAML, so it'd be great if you wanted to put together a PR.
Issue
When using mjml-rails in conjunction with haml, the expected haml behavior of embedding a Ruby link into a line with
=
resulted in inline HTML instead of a functioning link.Expected behavior
The code above should render a working link, correctly formatted, like this:
Resulting behavior
The HTML appears inline in the corresponding view.
Solutions
We were able to get the links working correctly with either
==
or!
(examples below). We ultimately went with the bang method (!
), but neither option successfully bypassed our Prettier checks.With the bang method, we're able to prevent interpolation escaping. More info here.
We were able to get everything to work by adding the file in question to our Prettier ignore file.
The text was updated successfully, but these errors were encountered: