Skip to content

The formatter should allow for backticks within quotes and vice versa #6998

Open
@keystroke3

Description

@keystroke3
          Hi there, I had some pixel art in my _Caddyfile_ in a `respond` directive in `v2.9.1`, that seemed to trigger an issue with `caddy fmt` when updating to `v2.10.0`.

I think this patch might be the cause, here is a minimal reproduction of the issue:

  • Caddyfile after caddy fmt --overwrite on v2.9.1:
:8080 {
	respond "`"
}

A caddy run will run an HTTP server and return a single backtick upon curl 127.0.0.1:8080.

  • Caddyfile after caddy fmt --overwrite on v2.10.0:
:8080 {
	respond "`"}

A caddy run will fail with: Error: adapting config using caddyfile: Unexpected '}' because no matching opening brace, at Caddyfile:2.

Thanks, I would post a separate issue if you prefered. :)

Note: this seems to be only triggered by an uneven number of backticks.

Originally posted by @lowlevl in #6903 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug 🐞Something isn't workinghelp wanted 🆘Extra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions