I send to my database a raw html
. But I want to create a slug
and to do that, I would prefer to use innerText
instead of html. I wanted to do
const div = document.createElement('div');
div.innerHTML = data.description;
let slug = slugify(div.innerText);
But NestJS throws an error. Is there any method that I could use to get somehow innerText
from this raw html
?