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

Closed
ttlg opened this Issue Mar 14, 2019 · 2 comments

Comments

Projects
None yet
2 participants
@ttlg
Copy link

ttlg commented Mar 14, 2019

Version

2.5.22

Reproduction link

https://jsfiddle.net/k6hxzmjc/5/

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

@Justineo

This comment has been minimized.

Copy link
Member

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

@ttlg

This comment has been minimized.

Copy link
Author

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.