Mange / roadie-rails

Making HTML emails comfortable for the Rails rockstars
MIT License
363 stars 65 forks source link

Unexpected line break in style attribute value #63

Open rafaelcamargo opened 8 years ago

rafaelcamargo commented 8 years ago

Hello folks!

Roadie Rails is an amazing tool, but I am facing this problem right now: unexpected_line_break

<table align="left" border="0" callpadding="0" callspacing="0" class="btn-container-wrapper " style="border-collapse:collapse"><tr><td class="btn-container " style="color:#333;font-family:Helvetica,Arial,sans-serif;font-size:13px;font-weight:400;text-align:left;line-height:120%"><table border="0" callspacing="0" class="btn btn-secondary is-small " style="width:200px;overflow:hidden;border-collapse:collapse;width:auto;text-transform:uppercase;color:#fff;text-decoration:none"><tr><td style='color:#333;font-size:13px;font-weight:400;text-align:left;line-height:120%;display:block;padding:8px 10px;width:auto;background-color:#ddd;font-family:Helvetica,Arial,sans-serif;text-align:center;line-height:initial;cursor:pointer;-webkit-box-sizing:"border-box";-moz-box-sizing:"border-box";box-sizing:"border-box";-webkit-border-radius:3px;-moz-border-radius:3px;-ms-border-radius:3px;border-radius:3px;padding-top:6px;padding-bottom:6px;background-color:#2C6CC6;color:#fff;text-decoratio
 n:none'><a href="http://jobscore-shorturls-staging.herokuapp.com/sbw" style="font-weight:400;outline:0;color:#2C6CC6;color:#333;color:#fff;text-decoration:none"><span class="btn-text" style="color:#333;font-family:Helvetica,Arial,sans-serif;font-size:13px;font-weight:400;text-align:left;line-height:120%;font-size:12px;color:#fff;text-decoration:none">Prepare for the interview</span></a></td></tr></table></td></tr></table>

In the final HTML for my transactional email, it sometimes occurs and I am not able to find the reason for now... Any idea?

Mange commented 8 years ago

I would expect this to be caused by some mail server/service somewhere in the chain. I don't think Nokogiri would cause this.

Does this happen to you when you don't send the email? In tests, for example.

rafaelcamargo commented 8 years ago

Hey @Mange , thanks for your reply. I have discovered the reason just now. I am a beginner with Rails, so the code above was printed out by a helper. This helper had a lot of nested content_tag. A friend of mine looked at this and said to me: "Awful!". Extract this code into a partial. Doing so, the problem got solved. It apparently was caused for several nested content_tag. Using a partial it had not occurred anymore.

Mange commented 8 years ago

Lovely! I'm glad you got it working again. 😀

Den mån 1 aug. 2016 20:48Rafael Camargo notifications@github.com skrev:

Hey @Mange https://github.com/Mange , thanks for your reply. I have discovered the reason just now. I am a beginner with Rails, so the code above was printed out by a helper. This helper had a lot of nested content_tag. A friend of mine looked at this and said to me: "Awful!". Extract this code into a partial. Doing so, the problem got solved. It apparently was caused for several nested content_tag. Using a partial it had not occurred anymore.

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/Mange/roadie-rails/issues/63#issuecomment-236670865, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAGP-ZzwOB2l0sT9OAxpaGLWftpW1GGks5qbj-DgaJpZM4JXpPE .