jira-cli icon indicating copy to clipboard operation
jira-cli copied to clipboard

Template content get escaped in {noformat}/{code} tags

Open olivergondza opened this issue 2 years ago • 2 comments

Describe the bug

Template content get incorrectly escaped in {noformat}/{code} tags.

Please provide following details

  1. JiraCLI Version:
1.4.0-1
(Version="v0.0.0-dev", GitCommit="", CommitDate="", GoVersion="go1.20.4", Compiler="gc", Platform="linux/amd64")
  1. Are you using Jira cloud or on-premise jira server?
SERVER INFO
-----------

Version:         9.4.2
Build Number:    940002
Deployment Type: Server
Default Locale:  
  1. 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
  1. 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 Screenshot from 2023-06-21 15-11-46

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.
    • Screenshot from 2023-06-21 15-20-40
    • (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.

olivergondza avatar Jun 21 '23 13:06 olivergondza

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 {{]}}).

funcode avatar Jun 25 '23 03:06 funcode