Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-51588

Newline tags are replaced after copy-pasting in Firefox and IE11

    XMLWordPrintable

Details

    Description

      Summary

      When you copy a text created in Chrome with new lines on the same paragraph using Firefox or IE, the <br /> is incorrectly replaced.
      The issue is happening in cell tables and outside.

      Steps to Reproduce

      1. Create a new page
      2. Insert a new table with four cells
      3. In cell #1, type lines using SHIFT + ENTER between each line (newlines within the same paragraph)
      4. Save the page
      5. In Firefox, edit the page
        1. Using any copy-pasting method:
          1. Select the whole text in cell #1
          2. Copy it
          3. Paste it in cell #2
        2. Save the page
      6. In IE11, do the same copy-pasting, this time from cell #1 to cell #3
      7. In Chrome, do the same copy-pasting, this time from cell #1 to cell #4

      In Storage Format, each cell's code will now look as follows:

      • Original (cell #1):
        <td>Line 1<br />Line 2<br />Line 3</td>
      • after copy-pasting in Firefox (cell #2):
        <td>
        <p>Line 1</p>
        <p>Line 2</p>
        <p>Line 3</p></td>
      • After copy-pasting in IE11 (cell #3):
        <td>Line 1 Line 2 Line 3</td>
      • After copy-pasting in Chrome (cell #4):
        <td>Line 1<br />Line 2<br />Line 3</td></tr>

      In other words, upon copy-pasting:

      • Chrome is the only one to retain correctly newline tags (<br />
      • Firefox replaces them by creating a paragraph for each line: <p> </p>
      • IE11 ignores newline tags completely (concatenes all lines into one single line)

      In Browse mode, the table now looks like the attached screenshot.

      The full page's Storage Format code is as follows:

      <table class="wrapped"><colgroup><col /><col /><col /><col /></colgroup>
      <tbody>
      <tr>
      <th>Original</th>
      <th>Firefox 51</th>
      <th>IE11</th>
      <th>Chrome 56</th></tr>
      <tr>
      <td>Line 1<br />Line 2<br />Line 3</td>
      <td>
      <p>Line 1</p>
      <p>Line 2</p>
      <p>Line 3</p></td>
      <td>Line 1 Line 2 Line 3</td>
      <td>Line 1<br />Line 2<br />Line 3</td></tr></tbody></table>
      

      The browser versions tested:

      • Firefox: 51.0.1
      • IE: 11.0.9600.18537
      • Chrome: 56.0.2924.87

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              bandreeti Bernardo Andreeti
              Votes:
              4 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: