Skip to content

feature: support scoped slots#133

Open
xdom wants to merge 2 commits intoEmranMR:mainfrom
xdom:feature/107-scoped-slots
Open

feature: support scoped slots#133
xdom wants to merge 2 commits intoEmranMR:mainfrom
xdom:feature/107-scoped-slots

Conversation

@xdom
Copy link
Copy Markdown

@xdom xdom commented Mar 10, 2026

Fixes #107.

Looks like it was never really properly fixed.

Supports both variants:

<x-slot:name>
...
</x-slot>

<x-slot:name>
...
</x-slot:name>

Checklist

  • deno check main/ to make sure the source code is fine
  • deno lint main/ to utilise the linter. You could also do
    deno lint --fix main/ to automatically fix
  • deno run generate ensure you include everything in the src/* - [ ] All
    tests pass in CI
  • There are enough tests for the new fix/feature
  • Grammar rules have not been renamed unless absolutely necessary (x rules
    renamed)
  • The conflicts section hasn't grown too much (x new conflicts)
  • The parser size hasn't grown too much (master: STATE_COUNT, PR:
    STATE_COUNT) >Check the value of STATE_COUNT in src/parser.c it should be
    roughly ~5k

xdom added 2 commits March 10, 2026 20:01
Add files generated by tree-sitter and deno.
@calebdw
Copy link
Copy Markdown
Collaborator

calebdw commented Mar 10, 2026

Looks like it's working:

image

@xdom
Copy link
Copy Markdown
Author

xdom commented Mar 11, 2026

To clarify, the original issue #107 requested that the parser supports a generic scoped slot closing tag </x-slot> instead of requiring a name-specific closing tag such as </x-slot:title>. This variant is also provided as an example in official Laravel docs.

Before:
image

After:
image

@calebdw
Copy link
Copy Markdown
Collaborator

calebdw commented Apr 4, 2026

Hmm, not sure I really care to support both variants---having the end tag match the start is better for consistency and readability

I'll leave it up to @EmranMR if he wants to support this

@EmranMR
Copy link
Copy Markdown
Owner

EmranMR commented Apr 6, 2026

Fixes #107.
Looks like it was never really properly fixed.

Yup, technically, it should now be possible! but it requires messing about with the html c parser.

I will reopen the issue though, so it is tracked again, and definitely hit it in the future when I get a chance :)

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.

Named slots break highlighting

3 participants