Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

self-closed HTML tag with v-html does not work correctly #9695

ttlg opened this Issue Mar 14, 2019 · 2 comments


None yet
2 participants
Copy link

ttlg commented Mar 14, 2019



Reproduction link

Steps to reproduce

render <div style="background-color:red;" /><div>bar</div> with v-html become <div style="background-color:red;"><div>bar</div></div>

What is expected?

We want:
<div style="background-color:red;"></div><div>bar</div>

Not this:
<div style="background-color:red;"><div>bar</div></div>

What is actually happening?

self closed tag wraps subordinate tags


This comment has been minimized.

Copy link

Justineo commented Mar 14, 2019

<div style="background-color:red;" /> is not valid HTML. v-html uses .innerHTML under the hood so it's never expected to work.

@Justineo Justineo closed this Mar 14, 2019


This comment has been minimized.

Copy link

ttlg commented Mar 14, 2019

thank you for your comment!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.