-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
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
vue-template-compiler fails when parsing a template with a comment as a root node. #9407
Comments
Ideally we would be able to retrieve this comment the normal way. How about using the same syntax as babel parser? Use the "leadingComment" property for the node if there is a next sibling. traiingComment the same way. The fix would then be 2 fold.
My PR will tke care of 1. I can create another issue for 2. |
…uejs#9408) In SFC templates, we are allowed to add comments to the root node. If parsing with comments flag true, we are not anymore. This ignores the root comments in case they cannot be added. fix vuejs#9407
Version
2.5.22
Reproduction link
https://codesandbox.io/s/52k2p9po54
Steps to reproduce
Go to the codesandbox.
Try to parse the given template with comments on.
What is expected?
The comment AST node should be attached to the root object.
What is actually happening?
I am going to try my hand at a PR. Wish me luck ;)
The text was updated successfully, but these errors were encountered: