Skip to content

fix(issues): interpret \n escape sequences in --description flag#162

Merged
piekstra merged 1 commit intomainfrom
fix/161-description-double-escapes-newlines
Feb 18, 2026
Merged

fix(issues): interpret \n escape sequences in --description flag#162
piekstra merged 1 commit intomainfrom
fix/161-description-double-escapes-newlines

Conversation

@piekstra
Copy link
Contributor

Summary

Fixes #161

  • Adds internal/text.InterpretEscapes() to convert C-style escape sequences (\n, \t, \\) in CLI flag values to actual control characters
  • Applies escape interpretation to --description in both jtk issues create and jtk issues update
  • Users can now use --description "First paragraph.\n\nSecond paragraph." and get proper paragraph breaks in Jira

Test plan

  • New unit tests for InterpretEscapes covering all edge cases (trailing backslash, unknown escapes, already-real newlines, empty string)
  • New integration test TestRunCreate_DescriptionEscapeSequences verifying escaped newlines produce multiple ADF nodes
  • All existing tests pass (go test ./tools/jtk/...)
  • Lint clean (golangci-lint run)

The --description flag passed literal \n characters through to ADF
conversion, resulting in visible \\n text in Jira instead of paragraph
breaks. Now interprets C-style escape sequences (\n, \t, \\) in the
description string before converting to ADF, matching user expectations
when using inline descriptions.

Adds internal/text package with InterpretEscapes utility for reuse by
other commands. Applied to both issues create and issues update.
@piekstra piekstra merged commit 3cbaf3c into main Feb 18, 2026
7 checks passed
@piekstra piekstra deleted the fix/161-description-double-escapes-newlines branch February 18, 2026 17:45
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.

jtk: --description flag double-escapes newlines in ADF conversion

1 participant

Comments