I have a customer who needs a high accessibility ranking due to it being a public service site and we have made great efforts to achieve an almost 10/10 score.
There is one item that has recently come to light that is flagging as something that needs addressing in regards to the HTML quality and that item is the fact that the Social Media Image urls are being output with unencoded ampersands. Is there anything that can be done to ensure they are output as encoded ampersands e.g.
Hi Richard - any suggestions on how to work around this? The problem I have is that its all tied up in the SeoChecker.SocialTags property and so I don't really think I can safely do a find & replace on ampersands in the HtmlString it returns.
Was thinking you could also render individual characters That isn't the case now but will implement this for V2.9 . Hope I can work on that this week and I post a Hotfix to that release here. Then you can access MetaData.Social.FacebookImage or something similar and encode that youself.
Encode Ampersands in Social Media Image Urls
Hi Richard,
I have a customer who needs a high accessibility ranking due to it being a public service site and we have made great efforts to achieve an almost 10/10 score.
There is one item that has recently come to light that is flagging as something that needs addressing in regards to the HTML quality and that item is the fact that the Social Media Image urls are being output with unencoded ampersands. Is there anything that can be done to ensure they are output as encoded ampersands e.g.
instead of ...
I'm not sure there is safe workaround in the interim?
Thanks, Simon
Hi Simon,
I believe I did that before and that was causing issues with preview in Facebook etc. Will have to check..
Best,
Richard
Hi Richard - any suggestions on how to work around this? The problem I have is that its all tied up in the
SeoChecker.SocialTags
property and so I don't really think I can safely do a find & replace on ampersands in theHtmlString
it returns.Hi Simon, Can't you use the social tags as well?
Hi Richard - I'm not sure I follow what you mean?
You could try HTML encoding the urls using:
HttpUtility.HtmlEncode(yourUrlValue)
https://docs.microsoft.com/en-us/dotnet/api/system.web.httputility.htmlencode?view=netframework-4.6.2
Sorry Simon,
Was thinking you could also render individual characters That isn't the case now but will implement this for V2.9 . Hope I can work on that this week and I post a Hotfix to that release here. Then you can access MetaData.Social.FacebookImage or something similar and encode that youself.
Sorry for the hassle for now.
Best,
Richard
Thanks Richard, that would work perfectly!
Hi Simon, what was the version of Umbraco? Hope it's V8 ;-)
No, v7 I'm afraid.
Hi Simon,
Forgot to reply but this issue was implemented a few weeks ago. You can download the hotfix here
Hope this helps,
Richard
Sorry I missed the update on this Richard but thanks. Do I just need the dll's out of this?
Update: Guessing this is v8 only after extracting the dll's
is working on a reply...