Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion models/record.go
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ func (rc *RecordConfig) ToComparableNoTTL() string {
// SoaSerial is not included because it isn't used in comparisons.
case "TXT":
// fmt.Fprintf(os.Stdout, "DEBUG: ToComNoTTL raw txts=%s q=%q\n", rc.target, rc.target)
r := txtutil.EncodeQuoted(rc.target)
r := txtutil.EncodeSingle(rc.target)
// fmt.Fprintf(os.Stdout, "DEBUG: ToComNoTTL cmp txts=%s q=%q\n", r, r)
return r
case "LUA":
Expand Down
7 changes: 7 additions & 0 deletions pkg/txtutil/txtcode.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,13 @@ func EncodeQuoted(t string) string {
return txtEncode(ToChunks(t))
}

// EncodeSingle encodes a string as a single quoted value without splitting
// into 255-octet chunks. This is intended for user-facing display (e.g., diff
// preview) where the chunked representation is confusing.
func EncodeSingle(t string) string {
return txtEncode([]string{t})
}

// State denotes the parser state.
type State int

Expand Down