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:
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?
Using <img> as link anchor breaks path to image
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:
turns into
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!
Josh
Hi Josh,
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.
Thanks, Lee.
Hi Lee,
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!
Josh
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?
Hi Connie,
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:
https://bitbucket.org/vertino/safemaillink-for-umbraco/src/default/Our.Umbraco.SafeMailLink/Utilities/Parser.cs?fileviewer=file-view-default#Parser.cs-31
Thanks,
- Lee
is working on a reply...