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

v-html error for commented(inactive) children elements #10741

Closed
mojanimator opened this issue Apr 19, 2024 · 2 comments
Closed

v-html error for commented(inactive) children elements #10741

mojanimator opened this issue Apr 19, 2024 · 2 comments

Comments

@mojanimator
Copy link

mojanimator commented Apr 19, 2024

Vue version

3

Link to minimal reproduction

not exists

Steps to reproduce

jus a div with v-html and some children that commented
error: [plugin:vite:vue] v-html will override element children.

<div  v-html="data.description"
            class="flex items-start p-2 max-w-2xl justify-center bg-gray-50 rounded-lg p-2">

         <!--            <div class="text-neutral-500  text-sm"></div>-->
  
  </div>

What is expected?

actualy after commenting children. there is not any children in parent

What is actually happening?

probably cant recognize commented children are inactive

System Info

No response

Any additional comments?

No response

@NathanFreeman
Copy link

HTML comments are indeed considered as nodes.

@yyx990803
Copy link
Member

This is expected. Some external tools rely on HTML comments for functioning, so overriding comments with v-html is not entirely safe.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants