I'm fetching some data in app from WordPress site successfully. Some entities like "„" react native don't want to make like quotes and many more issues I have.
Is there some way to make HTML entities right in React Native App?
Thanks in advance.
I had the same problem. This is the way I solved it:
First of all install html-entities :
npm install html-entities
In your code :
import {decode} from 'html-entities';
console.log(decode(stringToBeDecoded));
You should be able to use something like html-entities to decode the text before rendering:
const entities = new Entities();
entities.decode('„') // "„" (double low quotation mark)
Here's how to import and use a specific subpackage of Entities if the example in 'html-entities' README, which uses require(), won't work for you.
import {Html5Entities} from 'html-entities';
const entities = new Html5Entities();
entities.decode(stringToBeDecoded);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With