Skip to content

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

@jonnywilliamson

Description

@jonnywilliamson

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

CleanShot.2025-11-17.at.11.10.29.mp4

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions