Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-18073

The changes view (versions diff) does not preserve whitespaces

    XMLWordPrintable

    Details

    • Difficulty:
      Unknown
    • Documentation:
      N/A
    • Documentation in Release Notes:
      N/A
    • Similar issues:

      Description

      How to reproduce:

      1. Save&View a new page with content "empty"
      2. Edit and replace the content of the new page with a new content that contains more that 1 contiguous whitespace, anywhere on the line:
              line with      whitespaces   at various   locations   and        various             sizes         
      3. Save&view the new version.
      4. View mode preserves all the white spaces.
      5. Open the changes viewer and look at the diff of the new new version you've just saved.

      Expected:
      The line you have changed should be displayed exactly as it is in the page content, including all the lines.

      Actual:
      The line content is displayed, but all the contiguous whitespaces are squashed into 1 single whitespace.

      It gets even worse when your content is code and the indentation is broken. It makes the code really unreadable:

      New version:

      {{velocity}}
      #if ()
        #if ()
          #if ()
          #end
        #elseif ()
          #if ()
          #end
        #end
      #else
        #if ()
        #end
      #end
      {{/velocity}}
      

      Diff:

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              mflorea Marius Dumitru Florea
              Reporter:
              enygma Eduard Moraru
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Date of First Response: