A platform for community discussion. Free, open, simple.
DEV: Enable preserve_email_structure_when_styling by default
Daniel Waterworth931370664917
diff --git a/config/site_settings.yml b/config/site_settings.ymlindex 03c0d951f09..714fa88b7a0 100644--- a/config/site_settings.yml+++ b/config/site_settings.yml@@ -1131,7 +1131,7 @@ email:default: truehidden: truepreserve_email_structure_when_styling:- default: false+ default: truehidden: truefiles:diff --git a/spec/components/email/styles_spec.rb b/spec/components/email/styles_spec.rbindex 74addfe29dd..c53d56da888 100644--- a/spec/components/email/styles_spec.rb+++ b/spec/components/email/styles_spec.rb@@ -19,13 +19,6 @@ describe Email::Styles doendcontext "basic formatter" do-- it "works with an empty string" do- style = Email::Styles.new("")- style.format_basic- expect(style.to_html).to be_blank- end-it "adds a max-width to large images" dofrag = basic_fragment("<img height='auto' width='auto' src='gigantic.jpg'>")expect(frag.at("img")["style"]).to match("max-width")@@ -56,12 +49,6 @@ describe Email::Styles doendcontext "html template formatter" do- it "works with an empty string" do- style = Email::Styles.new("")- style.format_html- expect(style.to_html).to be_blank- end-it "attaches a style to h3 tags" dofrag = html_fragment("<h3>hello</h3>")expect(frag.at('h3')['style']).to be_present@@ -188,7 +175,7 @@ describe Email::Styles docooked = "Create a method for click on image and use ng-click in <img> in your slide box...it is simple"style = Email::Styles.new(cooked)style.strip_avatars_and_emojis- expect(style.to_html).to eq(cooked)+ expect(style.to_html).to include(cooked)endenddiff --git a/spec/integration/email_style_spec.rb b/spec/integration/email_style_spec.rbindex f0844dbd32a..f4df68333b6 100644--- a/spec/integration/email_style_spec.rb+++ b/spec/integration/email_style_spec.rb@@ -8,8 +8,8 @@ describe EmailStyle doit "does not evaluate ERB outside of the email itself" doSiteSetting.email_custom_template = "<hello>%{email_content}</hello><%= (111 * 333) %>"html = Email::Renderer.new(UserNotifications.signup(Fabricate(:user))).html- expect(html).not_to match("36963")- expect(html.starts_with?('<hello>')).to eq(true)+ expect(html).not_to include("36963")+ expect(html).to include('<hello>')endend