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
Great package. I have used the CodeArchitects.SafeMailLink for a while and have noticed that some link attributes doesn't really agree with it. For instance, if you add a title attribute or a class, the link will no longer be encoded.
A solution might be to rewrite it with the HtmlAgilityPack instead or Regular Expressions, allowing for very flexibel link matches or else you could tell the Umbraco editors, that they should not add titles to the email links.
I'll take a look into it... I've been using CodeArchitects.SafeMailLink for long time too - haven't really encountered the attribute problem, (guessing my clients don't modify their contact details much - I dunno).
I quite like the HtmlAgilityPack too ... might be better to rewrite/refactor it using that! :-)
Hi Bjørn, quick follow up on this.
I've tested a few variations of attributes in the link and it appears to be encoding correctly.
<a title="hello world" accesskey="E" href="mailto:firstname.lastname@example.org" class="link">Email Me</a>
... outputs to ...
I'll keep an eye out for anything strange going on.
Still curious about using HtmlAgilityPack - do you think there'd be any performance issues with using it for this? (e.g. loading/parsing full HTML)
Ah sorry looks like you are right. The CodeArchitects.SafeMailLink.dll I tested with was the one I normally use and that looks to be outdated.
In regards to HtmlAgilityPack I don't think that there would be a performance issue, but that is just based on my own experience. I generally just like the way you query with HAP and that it's so easy to read and maintain, compared (imho) to Regular Expressions. On the other hand, the package looks to be working just fine now :)
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted