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

Allow HTML Comments to not be removed from the DOM. #5392

Closed
mmaihoefner opened this issue Apr 7, 2017 · 2 comments
Closed

Allow HTML Comments to not be removed from the DOM. #5392

mmaihoefner opened this issue Apr 7, 2017 · 2 comments

Comments

@mmaihoefner
Copy link

What problem does this feature solve?

Currently Vue removes HTML Comments from the templates. It would be nice if we could disable this behavior via a configuration. The specific use case is that we are trying to use Vue with Magnolia CMS and Magnolia uses comments to figure out where to display its contribution interface. When Vue removes the comments Magnolia cannot place its contribution interface anymore, which renders the Page useless.

What does the proposed API look like?

new Vue({
comments: true | false
});
false: would function like the current behavior, true: would not remove the comments and keep them in the DOM.

@jblotus
Copy link

jblotus commented Apr 18, 2017

Just an idea...maybe as a workaround you can append the "comments" after a component activates/mounts...

You can store the "comments" in data()

https://developer.mozilla.org/en-US/docs/Web/API/Document/createComment

@mmaihoefner
Copy link
Author

Hi jblotus,
thanks for your suggestion, but I am not sure what you mean by appending the "comments" after the component activates. The "comments" are generated by Magnolia on the Server-Side via JSPs, so when the Page loads they are already there as part of the DOM. Or are you saying it is possible to get the "comments" from the DOM when the component activates and before Vue parses the DOM and removes them, so they can be re-added afterwards? I am also fairly new to Vue, so it would be much appreciated if you could provide a small example. Thanks again for your suggestion and for answering my (probably stupid) questions.

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

No branches or pull requests

3 participants