Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VELTOOLS-184 #13

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -44,6 +44,9 @@
* $javascript -> He didn't say, "Stop!"
* $esc.javascript($javascript) -> He didn\'t say, \"Stop!\"
*
* $json -> He didn't say, "Stop!"
* $esc.json($json) -> He didn't say, \"Stop!\"
*
* $html -> "bread" & "butter"
* $esc.html($html) -> "bread" & "butter"
*
Expand Down Expand Up @@ -301,6 +304,18 @@ public String javascript(Object string)
return StringEscapeUtils.escapeEcmaScript(String.valueOf(string));
}

/**
* <p>Escapes the characters in a <code>String</code> using JSON String rules.</p>
* <p>Delegates the process to {@link #java(String)}.</p>
*
* @param string the string to escape values, may be null
* @return String with escaped values, <code>null</code> if null string input
*/
public String json(Object string)
{
return java(string);
}

/**
* <p>Escapes the characters in a <code>String</code> using HTML entities.</p>
* <p>Delegates the process to {@link StringEscapeUtils#escapeHtml4(String)}.</p>
Expand Down