caddyfile: Add heredoc support to fmt command (#6056)

This commit is contained in:
bbaa 2024-01-22 10:24:49 +08:00 committed by GitHub
parent dba556fe4b
commit c0273f1f04
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 145 additions and 1 deletions

View file

@ -313,7 +313,7 @@ func (l *lexer) finalizeHeredoc(val []rune, marker string) ([]rune, error) {
// iterate over each line and strip the whitespace from the front
var out string
for lineNum, lineText := range lines[:len(lines)-1] {
if lineText == "" {
if lineText == "" || lineText == "\r" {
out += "\n"
continue
}