[
https://issues.apache.org/jira/browse/TEXT-40?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15878302#comment-15878302
]
Sebb commented on TEXT-40:
--------------------------
As per the discussion [1] on the dev mailing list, the method does not belong
in Commons TEXT.
Applications must keep track of whether a string has been escaped or not.
[1]
https://lists.apache.org/thread.html/65d0af56ab5c0a6e37d3430220287393c3349839106c1b39e58e5d81@%3Cdev.commons.apache.org%3E
> Escape HTML characters only once
> --------------------------------
>
> Key: TEXT-40
> URL: https://issues.apache.org/jira/browse/TEXT-40
> Project: Commons Text
> Issue Type: Improvement
> Reporter: Sampanna Kahu
> Assignee: Rob Tompkins
> 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 & 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.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)