Skip to content

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