Uploaded image for project: 'Jira Data Center'
  1. Jira Data Center
  2. JRASERVER-59793

Preformatted style with JSON text is broken

    XMLWordPrintable

Details

    Description

      NOTE: This bug report is for JIRA Server. Using JIRA Cloud? See the corresponding bug report.

      Issue Summary

      Pre-formatted is the style type that gives monospacing to text. This is traditionally used when referring to code (variable names, class names, etc...) or short pieces of code.

      Steps to Reproduce

      Write a text in the description of an issue with content like the following:
      "The HTTP response came back as {{

      {"result" : "success"}

      }} but ..."

      Expected Results

      The text is shown as it was written, in one single uninterrupted line.

      Actual Results

      The text is shown with line breaks instead of a single line.

      Notes

      • The impetus for this is javadocs which support tags such as: <tt>variableName</tt> (<code/> does the same thing) which will give monospace typing to variableName. Javadocs also support <pre>a bunch of code here</pre> which is handy for formatting a lot of code. JIRA handles the <pre/> situation quite well with the "code" tags. It makes an attempt to handle in-line monospace typing with "Preformatted". This works well most of the time, but it is completely broken when trying to use with JSON code snippets.
      • JavaDocs and other formatting tools support inline monospacing on code snippets for readability purposes, so should JIRA. In fact, Preformatting works well with code snippets for nearly any language EXCEPT JSON.

      Workaround

      To use the "code" formatting. Example:

      The HTTP response came back as {{{"result" : "success"}}} but ...

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              118d5d0701e7 Harrison Fortier
              Votes:
              9 Vote for this issue
              Watchers:
              11 Start watching this issue

              Dates

                Created:
                Updated: