storyblok / storyblok-js-client

Universal JavaScript client for Storyblok's API
MIT License
127 stars 87 forks source link

Issue with RichTextResolver and escapeHTML for Apastrophe #56

Closed JansonChe closed 4 years ago

JansonChe commented 4 years ago

Hi there :)

I ran into a rendering issue while using the RichTextResolver through the storyblok-nuxt package's this.$storyapi.richTextResolver.render() function, which, if I'm not mistaken, is part of this package.

The HTML escape for Apastrophe is defined like this: https://github.com/storyblok/storyblok-js-client/blob/6fc21e99bee70a63ba09462bd3232d4b53ba9774/source/richTextResolver.js#L8

Used in a Number e.g. 275'000, the renderer returns "275&#39000" which results in the browser showing "275願" instead of "250'000".

Adding a Semicolon to the escape definition seems to help: "'": '''

Maybe it's a different issue and I'm missing something?

Thanks a lot for your help! :)

emanuelgsouza commented 4 years ago

Hi! Thanks for submitting this issue!

Check the latest release v2.5.1.