You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Sampanna Kahu (JIRA)" <ji...@apache.org> on 2016/12/25 18:56:58 UTC
[jira] [Updated] (LANG-1303) Escape HTML characters only once
[ https://issues.apache.org/jira/browse/LANG-1303?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Sampanna Kahu updated LANG-1303:
--------------------------------
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 < 1000kg
Then the output of escapeHtml4() becomes:
100kg &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.
was:
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 < 1000kg
Then the output of escapeHtml4 becomes:
100kg &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.
> 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
> Labels: features, newbie
>
> 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 < 1000kg
> Then the output of escapeHtml4() becomes:
> 100kg &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)