DEV Community

zanetti4
zanetti4

Posted on

Rendered html is wrong by v-html

html error
I have got the strings from a request.

"<div><p class=\"my-3\">在东南亚国家联盟的组织框架下,东盟十国的旅游组织致力于共同发展和促进东盟十国成为理想的旅游目的地。</p><p class=\"my-3\">快来体验东盟国家独特的多样性、热情好客和美丽吧。在十个完美的旅游目的地体验美好的假期;在文莱、柬埔寨、印度尼西亚、老挝、马来西亚、缅甸、菲律宾、新加坡、泰国和越南感受我们对游客的热情。</p><p class=\"my-3\">合作伙伴:TTG Asia Media (https://www.ttgasiamedia.com/); Mekong Tourism (https://mekongtourism.org/)</p></div>"
Enter fullscreen mode Exit fullscreen mode

I want to render it by v-html.

<div v-html="formData.about_southeast_asia"></div>
Enter fullscreen mode Exit fullscreen mode

But the rendered html is wrong like the picture above. Why is it? Please someone help me. Thanks!

Top comments (0)

AWS Security LIVE!

Join us for AWS Security LIVE!

Discover the future of cloud security. Tune in live for trends, tips, and solutions from AWS and AWS Partners.

Learn More

Instrument, monitor, fix: a hands-on debugging session

Join Lazar for a hands-on session where you’ll build it, break it, debug it, and fix it. You’ll set up Sentry, track errors, use Session Replay and Tracing, and leverage some good ol’ AI to find and fix issues fast.

Tune in to the full event

DEV is partnering to bring live events to the community. Join us or dismiss this billboard if you're not interested. ❤️