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

Line endings for content in exported XML are inconsistent

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Minor
    • None
    • 1.1 M3, 6.4.5, 10.7
    • Model
    • None
    • white space, line endings, content, XML, import, export
    • Low
    • Awaiting Committer feedback

    Description

      Importing and exporting documents seems to result in a semi-arbitrary alternation between CR-LF and LF.

      I've been working on some applications and store the documents in svn (just as we do for xwiki-platform-applications). This means that I'm frequently importing and exporting those pages that I'm working on. The main body of the XML document is always LF separated, but the contents of the content tag (i.e. the document content, or the panel content, or the contents of any other field filled in by a textarea) seem to alternate between using CR-LF or just LF. It isn't a strict every-other-time change, but it is darn close, and seems especially likely to happen if you've restarted your webcontainer in-between exports.

      I'm not sure why this is, but it seems like the line endings used when exporting XML documents should be fixed: either always use CR-LF for textarea content, or don't. As a note, it seems that normal browser function (like cut and paste) works better when you've imported from a document using CR-LF line endings. Both appear with the same amount of whitespace in the textarea (wiki editor – I didn't try Wysiwyg), but when you copy and paste, text coming from the CR-LF XML will preserve its line breaks;, while pasting text from a document imported with only LF-separated content results in (essentially) a run-on sentence.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              ebullient Erin Schnabel
              Votes:
              1 Vote for this issue
              Watchers:
              6 Start watching this issue

              Dates

                Created:
                Updated: