Reputation: 27
I'm using October for my backend and a Vue.js app for rendering. My problem is that bold text saved in my database with Builder / Richeditor is not rendered as bold in my Vue.js app.
<p><strong>Duis convallis purus.</strong> suspendisse lobortis pharetra tempor....
Richeditor saves the bold with a <strong>
tag instead of <b>
and Vue doesn't render the bold this way with a template using the v-html
directive :
<div v-html="myHTMLdata"></div>
I found this topic which summarize the problem : https://developer.mozilla.org/en-US/docs/Web/HTML/Element/strong
Is there a way to tell October to use <b>
instead ?
Or maybe the solution could be in Vue.js ?
I searched a lot and didn't find any solution. Thanks for your help !
Upvotes: 0
Views: 143
Reputation: 600
I wouldn't recommend use v-html
directive if it's unsanitized. If your app is multiple languages-based, i would use Component Interpolation
approach of vue-i18n
Security (Vue): https://v2.vuejs.org/v2/guide/security.html Vue-i18n: https://kazupon.github.io/vue-i18n/guide/interpolation.html
Hope helps.
Upvotes: 1
Reputation: 27
Despite Kim's answer and the security considerations, for the moment I did the trick with CSS for tags b
and strong
which were override in the page.
Thanks
Upvotes: 0