When I use javascript encoding and the link content contains tab characters, Chrome says:
Uncaught URIError: URI malformed at decodeURIComponent (<anonymous>)
It seems decodeURIComponent is getting hung up on improperly encoded tab characters.
Removing the tab characters fixes the error.
I have tab characters because I'm using an ERB block:
<%= mail_to @job_posting.contact_email, encode: 'javascript' do -%>
Apply Now <img src="arrow.png">
<% end -%>
The obvious work-around is to not indent my code... But that's not a real solution.
I pulled the encoded string from Chrome's Sources tab and can see that the tab characters have been encoded as %9 instead of %09.
But shouldn't leading whitespace characters be stripped anyway? Because even if it did successfully encode the tab characters, they would appear in the output, which is obviously undesired.
When I use javascript encoding and the link content contains tab characters, Chrome says:
Uncaught URIError: URI malformed at decodeURIComponent (<anonymous>)It seems
decodeURIComponentis getting hung up on improperly encoded tab characters.Removing the tab characters fixes the error.
I have tab characters because I'm using an ERB block:
The obvious work-around is to not indent my code... But that's not a real solution.
I pulled the encoded string from Chrome's Sources tab and can see that the tab characters have been encoded as
%9instead of%09.But shouldn't leading whitespace characters be stripped anyway? Because even if it did successfully encode the tab characters, they would appear in the output, which is obviously undesired.