Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I have been using this package for a while and I love it, it makes life so much easier. I recently came across an issue that I am having trouble sorting. When I use an image (as opposed to text) as the link for my mailto it breaks the path to the image by adding <!--y--> just before the file extension, as such:
<a href="mailto:firstname.lastname@example.org"><img src="/images/graphics/email.png" alt"Click to email webmaster" width="16px" height="16px" /></a>
Am I missing something simple here or is this an undocumented feature (bug) in the package? Thanks in advance for any help and/or advice!
Thanks for raising this. Yep, sounds like an undocumented feature! :-) The code takes the text from inside the link and appends any "@" or "." characters with a HTML comment ("<!--x-->" or "<!--y-->") - this was to prevent spambots from crawlling any email addresses.
I could look at not replacing the "." characters - if that helps? Happy to take advice on this.
Not replacing the "." character would certainly address this issue, but would that compromise the effectivness of the package preventing the evil spambots from doing their inevitable crawling? I am grasping here, but if there was an escape sequence that would cause the code to ignore a particular period...? Another possibility I suppose would be to parse the string and check for an <img> tag which could then be ignored.
Maybe someone has a suggestion on something to do in the HTML itself that would get around the issue...
If you decide to address this issue, please let me know, but regardless, thanks for the great package!
I too am coming up against this issue and wonder if it has been resolved. Could you not just ignore the source (src) property of any image tags inside the mailto?
I haven't touched the code for SafeMailLink in around 3 years. Currently I have no plans to revisit it.
Although if you have any ideas on how to fix the code to handle the <img> tag, I'd be more motivated to release an update.
Here's the line of code that replaces the "." character:
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted