Uploaded image for project: 'XWiki Commons'
  1. XWiki Commons
  2. XCOMMONS-405

Add a method to the escape tool to encode new line characters in XML attribute values

    XMLWordPrintable

Details

    • New Feature
    • Resolution: Unresolved
    • Major
    • None
    • 5.0-milestone-1
    • Velocity
    • None

    Description

      Since the upgrade to HTML Cleaner 2.5 (XCOMMONS-403) new line characters are not preserved any more in attribute values. For instance, if you write in an HTML form:

      <input type="hidden" name="foo" value="$multiLineText" />
      

      on submit, the value of $request.foo will have all new line characters replaced with a space character.

      We need a way to encode the new line characters in order to preserve them. Currently the workaround is to replace them like this:

      <input type="hidden" name="foo" value="$multiLineText.replaceAll("\n", '&#10;')" />
      

      But more generally, we need to encode the tab \t, the carriage return \r and possibly other white-space characters.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              mflorea Marius Dumitru Florea
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: