Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix caddy fmt breaks backquote wrapped braces in template #6903

Merged
merged 1 commit into from
Mar 17, 2025

Conversation

keystroke3
Copy link
Contributor

This addresses issue #6859 by writing the opening and closing braces and ignoring indentation when it detects that we the cursor is currently within a backquote section.

I have added 2 new tests for the two cases where the braces are wrapped with regular quotes and backquotes. I have confirmed that it works at least with the following example:

block {
	header Content-Type text/plain
	templates
	respond "Home page date: {{now | date `2006`}}"

	handle /path {
		header Content-Type text/plain
		templates
		respond `Path page date: {{now | date "2006"}}`
	}
}

@CLAassistant
Copy link

CLAassistant commented Mar 16, 2025

CLA assistant check
All committers have signed the CLA.

Copy link
Member

@mholt mholt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the patch!

@mholt mholt merged commit b3e692e into caddyserver:master Mar 17, 2025
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants