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

Add support for slot shorthand syntax to Vue lexer #1483

Merged
merged 2 commits into from
Apr 7, 2020

Conversation

pyrmont
Copy link
Contributor

@pyrmont pyrmont commented Apr 7, 2020

As of Vue 2.6.0, it is possible to use a shorthand syntax for specifying slots. To tokenise the syntax correctly, the HTML :tag state must be amended to allow a tag's attributes to include the # character.

This fixes #1479.

@pyrmont pyrmont added the needs-review The PR needs to be reviewed label Apr 7, 2020
@pyrmont pyrmont self-assigned this Apr 7, 2020
@pyrmont
Copy link
Contributor Author

pyrmont commented Apr 7, 2020

@pavelda2 How does this look to you? I'm lexing it the same way the non-shorthand syntax is handled (see below).

vue

@pavelda2
Copy link

pavelda2 commented Apr 7, 2020

Yes, this is requested highlighting 👍 .

@pyrmont pyrmont merged commit f054b73 into rouge-ruby:master Apr 7, 2020
@pyrmont pyrmont deleted the bugfix.vue-slot-shorthand branch April 7, 2020 23:04
@pyrmont pyrmont removed the needs-review The PR needs to be reviewed label Apr 7, 2020
@pyrmont
Copy link
Contributor Author

pyrmont commented Apr 7, 2020

Thanks @pavelda2! This fix will go out in version 3.18.0 of Rouge. That's scheduled for release on Tuesday 14 April 🎉

mattt pushed a commit to NSHipster/rouge that referenced this pull request May 21, 2020
As of Vue 2.6.0, it is possible to use a shorthand syntax for
specifying slots. To tokenise the syntax correctly, the HTML `:tag`
state must be amended to allow a tag's attributes to include the `#`
character. This commit makes that change.
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

Successfully merging this pull request may close these issues.

Add support for Vue.js slot shorthand
2 participants