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! :-)
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 :)
Attributes in mailto link
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.
Thanks Bjørn,
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! :-)
Cheers, Lee.
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.
Example...
... 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)
Cheers, Lee.
Hi Lee,
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 :)
Cheers
Bjørn
is working on a reply...