How to replace & in areaLabel?
Answered
Japanese Bobtail posted this in #help-forum
Japanese BobtailOP
I use dangerouslySetInnerHTML to replace & with & (and other characters) inside the link. But how can i replace characters in attributes like aria-label? Do I need to use a custom function to do this?
'
'
<Link
href={link}
dangerouslySetInnerHTML={{ __html: name }}
ariaLabel={
Open category ${name}}
/>
Answered by Japanese Bobtail
Now i'am using the html-entities package to decode all chars for the html attributes: https://www.npmjs.com/package/html-entities
1 Reply
Japanese BobtailOP
Now i'am using the html-entities package to decode all chars for the html attributes: https://www.npmjs.com/package/html-entities
Answer