8000 fix(vue): handle more edge cases for tags by Gusted · Pull Request #1069 · alecthomas/chroma · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fix(vue): handle more edge cases for tags #1069

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

Merged
merged 1 commit into from
Apr 19, 2025

Conversation

Gusted
Copy link
Contributor
@Gusted Gusted commented Apr 18, 2025

Screenshot

The syntax highlighting of the input is still not perfect (e.g. HTML comment and symbol-id=), but it's a lot better now.

Before

image

After

image

- Allow parsing of attributes to end on `/>`, `>` or a whitespace
character.
- Consilidate the parsing of the shorthand `@EVENT` to one rule. Do
better parsing for its contents by allowing
whitespace (`@click="menuVisible = !menuVisible"`) and `EVENT` to
contain a dot (`@keyup.enter`). Allow it to not have any condition (`<a
@click.stop>`).
- Allow `v-` directives to contain a dash.
- Move a rule down that captures `v-on:click="doSomething"` as it was
included more than it should for the `LiteralString` token.
- Add tests that should exhaustively tests these edge cases. They were
derived from https://codeberg.org/forgejo/forgejo/src/commit/a18fc8b03702f439845daf22a0cc7fb0f8ea95c3/web_src/js/components/RepoBranchTagSelector.vue#L248-L318
@alecthomas
Copy link
Owner

Nice!

@alecthomas alecthomas merged commit 5409db0 into alecthomas:master Apr 19, 2025
2 checks passed
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.

4 participants
0