austenc / vscode-blade-spacer

Laravel Blade Spacer plugin for VSCode
8 stars 2 forks source link

Problems closing tags #33

Open ultrait-sistemas opened 1 month ago

ultrait-sistemas commented 1 month ago

Good extension. But I have a problem where the tag is closed

I have this line

<a class="btn" href="#" data-to-user=""><b>{{ __('Contact') }}</b></a>

When I write the open tag characters {{ inside the data-to-user field, the extension delete part of the line.

<a class="btn" href="#" data-to-user="{{ }}</b></a>

Aparently the proble is that I had a previous tag close }} in the same line. Here {{ __('Contact') }}

austenc commented 3 weeks ago

Thank you for reporting this. Did you perhaps have a selection made when doing this?

The way the extension works is based on the VS Code snippets feature. It uses a (hopefully) non-greedy regular expression to match and replace with a given snippet depending on the blade tag type (comment, double curlies, etc...).

Anyway, I'm not able to reproduce your error, so if you can provide some additional context or a reproduction, I'd be happy to look into it further. Here's what is happening when I try to reproduce with your example:

https://github.com/user-attachments/assets/af1e36ae-bb11-4847-b1c7-996c2132990d