jgm / pandoc

Universal markup converter
https://pandoc.org
Other
33.94k stars 3.34k forks source link

Jira writer: First backslash will be escaped with HTML #7949

Open pueblofunky opened 2 years ago

pueblofunky commented 2 years ago

Explain the problem.

In a Markdown file I have the line

  1. Save the installer on a local disc, e.g. `C:\Data\Temp`.

and when I run

pandoc README.md -f markdown -o README.jira -t jira

it results in

# Save the installer on a local disc, e.g. {{C:\Data\Temp}}.

The first backslash is replaced by HTML code.

Finally I can't import the complete file within Confluence MarkUp macro (Confluence wiki) because it can't parse it.

This works:

# Save the installer on a local disc, e.g. {{C:\Data\Temp}}.

Pandoc version? What version of pandoc are you using, on what OS? 2.17.1.1 on Windows 10 / CMD

Confluence version we use: 7.13.3

mb21 commented 2 years ago

{{C:\Data\Temp}} works for me when creating a ticket in Jira v8.20.2. But it's true that it completely bricks the "insert markup" feature in Confluence 7.13.2:

fine:

grafik

preview is broken and outputs just what was input:

grafik

ricnorr commented 2 years ago

In my opinion it is a bug in jira-wiki-markup. The problem happens in this method: https://github.com/jgm/pandoc/blob/b7a44f9d19f547374445bbc0b44e4dfbbca1dca0/src/Text/Pandoc/Writers/Jira.hs#L247, it wraps a text in Jira.Str, and then jira-wiki-markup printing replaces first backslash.