wrabit / django-cotton

Enabling Modern UI Composition in Django
https://django-cotton.com
MIT License
506 stars 20 forks source link

Passing down hyperscript to attrs with selector / HTML attribute are auto-completed #198

Closed alfonsrv closed 2 weeks ago

alfonsrv commented 2 weeks ago

This might be very niche, but I'm using _hyperscript (which is an library of the maker of htmx)

When passing down a hyperscript directive as part of {{ attrs }}, things that look like HTML tags are autocompleted. So this:

<c-foo _="on click from <span[role='button']/> log event"> </c-foo>

becomes:

<div _="on click from <span[role='button']></span[role='button']> log event">

which breaks the syntax. Maybe attrs having encapsulated parentheses values can be ignored for autocompletion?

wrabit commented 2 weeks ago

Hi @alfonsrv can you confirm you are using the latest version? Earlier uses BS4 which will attempt to “fix” html.

wrabit commented 2 weeks ago

@alfonsrv closing for now, please let me know if you still have issues with this