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

Pasting into prefotmatted box removes line breaks

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Low Low
    • None
    • 7.13.5, 8.8.0
    • Rich Text Editor
    • None

      Issue Summary

      When copying some texts into a preformatted box, in some situations it removes the line breaks.

      Steps to Reproduce

      I found 2 distinct situations in which the line breaks vanish in the preformatted box:

      1. HTML content. That means when you copy some content and it goes as HTML content to the clipboard. It happens on Word, Visual Studio, Web browsers... anything that keeps the formatting over the clipboard.
      2. When there is more than one line break with carriage return in a row, it removes all of them instead of at least leaving one behind. This applies to Windows notepad, putty, and so on.
        On Mac, for example, it's common to have only line breaks without the carriage returns, and it removes only the several in a row, leaving one behind.

      Expected Results

      In all cases, the text paste should behave in the same way.

      Actual Results

      Depending on the text line breaks form, it behaves differently.

      For example, let's take the text:

              <name>Issue Comment Deleted</name>
              <template>issueupdated.vm</template>
      
      
              <templatetype>issueevent</templatetype>
          </templatemapping>
      

      If it has only line feeds, and it's copied to the preformatted box, we get the expected result:

              <name>Issue Comment Deleted</name>
              <template>issueupdated.vm</template>
              <templatetype>issueevent</templatetype>
          </templatemapping>

      If it uses line feed+ carriage return, we get an extra line break removed:

              <name>Issue Comment Deleted</name>
              <template>issueupdated.vm</template><templatetype>issueevent</templatetype>
          </templatemapping>

      If copied from Visual Studio Code, or any browser that does it in HTML in the clipboard:

              <name>Issue Comment Deleted</name>        <template>issueupdated.vm</template>
      
              <templatetype>issueevent</templatetype>    </templatemapping>

      Workaround

      To use the "code" format box, or paste into the text mode.

              Unassigned Unassigned
              5fb7769fcbc7 Allan Gandelman
              Votes:
              11 Vote for this issue
              Watchers:
              10 Start watching this issue

                Created:
                Updated: