GitHub user SampannaKahu opened a pull request:

    https://github.com/apache/commons-lang/pull/222

    LANG-1303 : Escape HTML characters once

    Hi, this is my first time contributing to any open source project.
    The feature goes as follows:
    
    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 < 1000kg
    
    At my workplace, we felt the need for a method in StringEscapeUtils which 
does not escape already escaped characters.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/SampannaKahu/commons-lang escape_html_once

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/commons-lang/pull/222.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #222
    
----
commit a5786ee8bab5b06e53ddc436326fef3cd8f2adfa
Author: SampannaKahu <[email protected]>
Date:   2016-12-23T19:00:47Z

    Adding a new html4 translator to escape HTML characters only once.
    This prevents single, double or recursive escaping of html characters.

commit a198671e2d4ced8d4363f5d7fd2aa3f60d236f16
Author: SampannaKahu <[email protected]>
Date:   2016-12-23T19:25:47Z

    1. Using SingleLookupTranslator directly, instead of passing it to 
AggregateTranslator.
    2. Added escapeHtml3Once() method.
    3. Commenting improvements.

commit 4b21f7c5a1384bf6ced59121f1c36c962c3c939a
Author: SampannaKahu <[email protected]>
Date:   2016-12-25T18:43:16Z

    Merge branch 'escape_html_once' of 
https://github.com/SampannaKahu/commons-lang into escape_html_once

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to