bbc / psammead

React component library for BBC World Service and more
https://bbc.github.io/psammead/
Other
320 stars 54 forks source link

Remove special characters from Story Promo - IndexAlsos aria-labels #4602

Closed amoore108 closed 2 years ago

amoore108 commented 2 years ago

Resolves https://github.com/bbc/simorgh/issues/9696

Overall change:

Removes special characters from IndexAlsos aria-labels as IDs cannot contain them.


amoore108 commented 2 years ago

Looks good.

Will we still render huge IDs though? Should we also parse something shorter and unique from the urls in Simorgh that are passed in here

Yea there is a potential that the IDs could still be huge, although I think the error was generated from the special characters rather than the overall length.

We could try and get the asset ID from the URL, which should always be the value after the last / if I'm correct?

ryanmccombe commented 2 years ago

We could try and get the asset ID from the URL, which should always be the value after the last / if I'm correct?

I believe these links aren't programmatic - editorial can put almost anything in the URL. The one we noticed the issue on had a twitter querystring in it

amoore108 commented 2 years ago

We could try and get the asset ID from the URL, which should always be the value after the last / if I'm correct?

I believe these links aren't programmatic - editorial can put almost anything in the URL. The one we noticed the issue on had a twitter querystring in it

Ah yea, dang. Probably safest just to strip out the special chars then, even if it means some long looking IDs.