Author Topic: Any way to render HTML problem correctly?  (Read 2655 times)

Offline techdesign

  • Newbie
  • *
  • Posts: 5
Any way to render HTML problem correctly?
« on: September 18, 2012, 11:50:12 PM »
I have a customer that receives email from an insurance company with an html "button" they need to push to access documents. In the raw email, the link comes through like this:

Code: [Select]
<a style=3D'text-decoration:none; color:#cc6600; font-weight:bold;' href=3D'https://blah.blah.com/bunchofstuff/Authentication=3Fmod=3Dc&amp;code=12345'/>Access the Document Center</a>
(obviously I changed the link for security)

I understand that the forward slash at the end of the opening <a> element is incorrect, and Roundcube ends up producing html that looks like this:

Code: [Select]
<a style="text-decoration: none; color: #cc6600; font-weight: bold;" href="https://blah.blah.com/bunchofstuff/Authentication?mod=c&amp;code=12345" target="_blank"></a>Access the Document Center
This ends up rendering the link unusable of course. I have verified this by removing the trailing forward slash in the email stored on the server, and it then renders just fine.

The external mail clients I have tried (Outlook, Thunderbird, etc) are apparently more forgiving than Roundcube and render this in a manner that still allows the link the work.

Is there anything that can be done in Roundcube to get this to render properly? I understand the sender should probably fix their end, but we all know how often that happens...

Offline alec

  • Hero Member
  • *****
  • Posts: 1,365
Re: Any way to render HTML problem correctly?
« Reply #1 on: September 19, 2012, 02:19:22 AM »
There's no such option in Roundcube. To fix this you'll need to fix HTML content before it's parsed by washtml class. You can do this in rcmail_wash_html() function in program/steps/mail/func.inc. There you will find some similiar hacks.