From e0fdcbf177885686cf24dd2fb8d44a8d256b7828 Mon Sep 17 00:00:00 2001 From: Hinne Stolzenberg Date: Tue, 24 Mar 2026 04:52:53 +0100 Subject: [PATCH 1/2] fix: support multiline text in --field for textarea custom fields The --field flag truncated textarea values at the first newline because literal \n from shell double-quotes was passed through as two characters. TextToADF expects actual newlines to split paragraphs. Unescape literal \n sequences before passing to TextToADF, so `--field "Kontext=line1\n\nline2"` produces two paragraphs instead of one. --- internal/cmd/issue/field_util.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/cmd/issue/field_util.go b/internal/cmd/issue/field_util.go index d867590..068523c 100644 --- a/internal/cmd/issue/field_util.go +++ b/internal/cmd/issue/field_util.go @@ -77,6 +77,9 @@ func coerceFieldValue(field *api.Field, value string) interface{} { return options } if strings.Contains(customType, "textarea") { + // Support literal \n in command-line values (shell double-quotes + // don't interpret \n, so users pass it as two characters). + value = strings.ReplaceAll(value, `\n`, "\n") return api.TextToADF(value) } if field.Schema.Type == "array" && field.Schema.Custom == "" { From 98c64258829453189fa463db35939b00157936f4 Mon Sep 17 00:00:00 2001 From: Hinne Stolzenberg Date: Tue, 24 Mar 2026 05:31:25 +0100 Subject: [PATCH 2/2] fix: handle escaped backslashes in --field textarea values Support \\ for literal backslashes so that content like Windows paths (C:\Users\normal) or code snippets (printf("hello\n")) can be represented correctly by escaping: C:\\Users\\normal, printf("hello\\n"). Uses placeholder-based replacement chain to avoid double-processing. --- internal/cmd/issue/field_util.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/cmd/issue/field_util.go b/internal/cmd/issue/field_util.go index 068523c..8e4fcd4 100644 --- a/internal/cmd/issue/field_util.go +++ b/internal/cmd/issue/field_util.go @@ -77,9 +77,9 @@ func coerceFieldValue(field *api.Field, value string) interface{} { return options } if strings.Contains(customType, "textarea") { - // Support literal \n in command-line values (shell double-quotes - // don't interpret \n, so users pass it as two characters). - value = strings.ReplaceAll(value, `\n`, "\n") + // Support literal \n for newlines and \\ for literal backslashes. + // Handles: "line1\nline2" → two lines, "C:\\path" → C:\path + value = strings.ReplaceAll(strings.ReplaceAll(strings.ReplaceAll(value, `\\`, "\x00"), `\n`, "\n"), "\x00", `\`) return api.TextToADF(value) } if field.Schema.Type == "array" && field.Schema.Custom == "" {