commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sampanna Kahu (JIRA)" <j...@apache.org>
Subject [jira] [Created] (LANG-1303) Escape HTML characters only once
Date Sun, 25 Dec 2016 18:05:58 GMT
Sampanna Kahu created LANG-1303:
-----------------------------------

             Summary: Escape HTML characters only once
                 Key: LANG-1303
                 URL: https://issues.apache.org/jira/browse/LANG-1303
             Project: Commons Lang
          Issue Type: Improvement
          Components: lang.text.*
            Reporter: Sampanna Kahu
            Priority: Minor


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

For example:
If the input is:
100 kg &lt; 1000kg
Then the output of escapeHtml4 becomes:
100kg &amp;lt; 1000kg

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.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message