Uploaded image for project: 'Commons Text'
  1. Commons Text
  2. TEXT-40

Escape HTML characters only once

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • None
    • Patch

    Description

      If already escaped HTML characters are in the input test, they get escaped again using StringEscapeUtils.escapeHtml4().

      For example:
      If the input is:
      100 kg & l t ; 1000kg <without the spaces>
      Then the output of escapeHtml4() becomes:
      100kg & amp ; l t ; 1000kg <without the spaces>

      At my workplace, we felt the need for a method in StringEscapeUtils which does not escape already escaped characters.

      I have attempted to create this method. Creating a pull request soon.

      Attachments

        Issue Links

          Activity

            People

              chtompki Rob Tompkins
              sampyash Sampanna Kahu
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: