Hi there,
I’m continue working with WordPress. I get my titles retrieved via API like this:
„go-digital“ oder „Digital Jetzt!“? – 2023
A way would be to use he.decode with the he library. Probably its not available?
Is there another way than manually replacing all those encoded characters?
I ran some tests and I don’t think document is available, Loadash also didn’t seem to work however a slight modification to John’s code did appear to work:
function decodeHtml(html) {
return html.replace(/&#(\d+);/g, function(match, dec) {
return String.fromCharCode(dec);
});
}
let encodedString = base;
let r4 = decodeHtml(encodedString);
console.info('R4', r4);
I love this community and the level of teamwork that exists -reminds me of Rainer and Andreas when GF first launched. I hope we never lose this collaborative effort.