blade-parser-typescript icon indicating copy to clipboard operation
blade-parser-typescript copied to clipboard

{-- format-ignore-start --}} Only works if there is code after the closing tag.

Open jonnywilliamson opened this issue 2 months ago • 1 comments

Hi there, thanks for this plugin!

Just want to know if the following is expected behaviour as it's catching me out in a few places in my codebase.

If I have some unformatted code like this

            <div>
                text A</div>
            {{-- format-ignore-start --}}
            <div>
                text B</div>
            {{-- format-ignore-end --}}

And save the file (prettier is set to run on save), absolutely nothing happens. But as soon as I add ANY code/text AFTER the closing tag, then it will format instantly:

            <div>
                text A</div>
            {{-- format-ignore-start --}}
            <div>
                text B</div>
            {{-- format-ignore-end --}}
            <div>
                text C</div>

Will become

<div>text A</div>
{{-- format-ignore-start --}}
            <div>
                text B</div>
            {{-- format-ignore-end --}}
<div>text C</div>

Which is what I expect.

I've left a short video showing this in action, just wanted to know is this the way it should work? Its seems like it should always format AROUND the ignore tags even if the closing tag is at the end of the file?

Thank you

https://github.com/user-attachments/assets/4621f583-2af7-497b-a8bc-52d0805cc2b2

jonnywilliamson avatar Nov 17 '25 11:11 jonnywilliamson

Thanks for the demo video and code snippets! Will be working to improve this in the next major version

JohnathonKoster avatar Nov 17 '25 14:11 JohnathonKoster