How to ignore html tags in tinymce | Vuejs and Laravel

本小妞迷上赌 提交于 2019-12-11 07:23:03

问题


I am building an application using laravel and vuejs but for some reason I cannot use tinymce properly.

I see the editor as I want and write whatever I want in it. But when I try to view the content, all the html tags show as you can see in the image

I installed it following the github documentation here

npm install @tinymce/tinymce-vue

Imported in my vue template

import Editor from '@tinymce/tinymce-vue';

components: {
    'editor' : Editor
}

And then I bind the element

<editor v-model="post.description"></editor>

So instead of showing " This text will be bold", it should show me "This text will be bold"


回答1:


After some research I ended up realising that I had to use the v-html in order to read the html tags

so instead of showing like this:

<td>{{post.description}}<td>

I am now doing the following:

<td v-html="post.description"><td>



回答2:


I think you are using TinyMCE proper way. It returns HTML, not a plain text. And when you remove tags from that returned HTML, you will lost all formatting, images and links. But if this is what are you looking for, just dive into TinyMCE documentation - it's a question of configuration.



来源:https://stackoverflow.com/questions/50953623/how-to-ignore-html-tags-in-tinymce-vuejs-and-laravel

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!