jira-cli
jira-cli copied to clipboard
Template content get escaped in {noformat}/{code} tags
Describe the bug
Template content get incorrectly escaped in {noformat}/{code} tags.
Please provide following details
- JiraCLI Version:
1.4.0-1
(Version="v0.0.0-dev", GitCommit="", CommitDate="", GoVersion="go1.20.4", Compiler="gc", Platform="linux/amd64")
- Are you using Jira cloud or on-premise jira server?
SERVER INFO
-----------
Version: 9.4.2
Build Number: 940002
Deployment Type: Server
Default Locale:
- What operating system are you using? Also mention version.
Linux arch 6.3.8-arch1-1 #1 SMP PREEMPT_DYNAMIC Wed, 14 Jun 2023 20:10:31 +0000 x86_64 GNU/Linux
- What terminal are you using? Also mention version.
kitty 0.28.1
No interactive features involved here, though.
To Reproduce
Steps to reproduce the behavior:
Using jira issue create --project CCITJEN --type Story --summary "Test" --template ./template --no-input. with the ./template:
Careful with the dashes ({{-}}), square-brackets ({{[}} and {{]}}), and exclamation marks({{!}})!
{code}
Careful with the dashes (-), square-brackets ([ and ]), and exclamation marks!
{code}
{noformat}
Careful with the dashes (-), square-brackets ([ and ]), and exclamation marks!
{noformat}
Actual behavior
What I see in JIRA UI issue body is
The markdown presented on text edit is:
Careful with the dashes \({{\-}}\), square\-brackets \({{\[}} and {{\]}}\), and exclamation marks\({{\!}}\)\!
{code}
Careful with the dashes \(\-\), square\-brackets \(\[ and \]\), and exclamation marks\!
{code}
{noformat}
Careful with the dashes \(\-\), square\-brackets \(\[ and \]\), and exclamation marks\!
{noformat}
Expected behavior
- The description to be presented as if the content were pasted into UI edit text window.
- (Apparently, it is not satisfied with the
{{[}}. Ironically when I let the WYSIWYG editor in JIRA to convert[in preformatted test, it uses this. Though it is unrelated to this issue.)
- The markdown presented on JIRA UI edit to be more or less identical. Now it is infested with backslashes.
This probably is due to the same cause as #407. After I changed md.ToJiraMD to return the input string immediately without doing anything, the markdown works well, except for ({{[}} and {{]}}).