Is there a method somewhere that reads structure text field value as a string in Javascript client ?
I am doing a search-index with Javascript client and would love to extract plain text from structure fields.
Thanks,
Primoz
Is there a method somewhere that reads structure text field value as a string in Javascript client ?
I am doing a search-index with Javascript client and would love to extract plain text from structure fields.
Thanks,
Primoz
Hello @primoz.rome i think you are looking for this right here: datocms-structured-text-to-html-string - npm
Not 100% perfect, but it will do. I can easily strip Html tags from the contentβ¦
There is also a package which should exactly do what you want:
https://www.npmjs.com/package/datocms-structured-text-to-plain-text
Exactly @mjablonski, thank you!
I had forgotten about that.
And welcome to the community by the way
Uh yes @mjablonski , this one is exactly what I need. Super!