Added links to wiki for EncodeHtml, EncodeJs, EncodeJson and EncodeXml
This commit is contained in:
parent
0f62f9cb5b
commit
cea371ed31
7 changed files with 16 additions and 36 deletions
|
@ -32,6 +32,7 @@ import rife.tools.StringUtils;
|
|||
* </pre>
|
||||
*
|
||||
* @author <a href="https://erik.thauvin.net/">Erik C. Thauvin</a>
|
||||
* @see <a href="https://github.com/rife2/rife2-template-renderers/wiki/rife.render.EncodeHtml">rife.render.EncodeHtml</a>
|
||||
* @see StringUtils#encodeHtml(String)
|
||||
* @since 1.0
|
||||
*/
|
||||
|
|
|
@ -32,6 +32,7 @@ import rife.tools.StringUtils;
|
|||
* </pre>
|
||||
*
|
||||
* @author <a href="https://erik.thauvin.net/">Erik C. Thauvin</a>
|
||||
* @see <a href="https://github.com/rife2/rife2-template-renderers/wiki/rife.render.EncodeJs">rife.render.EncodeJs</a>
|
||||
* @see StringUtils#encodeJson(String)
|
||||
* @since 1.0
|
||||
*/
|
||||
|
|
|
@ -32,6 +32,7 @@ import rife.tools.StringUtils;
|
|||
* </pre>
|
||||
*
|
||||
* @author <a href="https://erik.thauvin.net/">Erik C. Thauvin</a>
|
||||
* @see <a href="https://github.com/rife2/rife2-template-renderers/wiki/rife.render.EncodeJson">rife.render.EncodeJson</a>
|
||||
* @see StringUtils#encodeJson(String)
|
||||
* @since 1.0
|
||||
*/
|
||||
|
|
|
@ -32,6 +32,7 @@ import rife.tools.StringUtils;
|
|||
* </pre>
|
||||
*
|
||||
* @author <a href="https://erik.thauvin.net/">Erik C. Thauvin</a>
|
||||
* @see <a href="https://github.com/rife2/rife2-template-renderers/wiki/rife.render.EncodeXml">rife.render.EncodeXml</a>
|
||||
* @see StringUtils#encodeXml(String)
|
||||
* @since 1.0
|
||||
*/
|
||||
|
|
|
@ -51,10 +51,10 @@ public final class RenderUtils {
|
|||
}
|
||||
|
||||
/**
|
||||
* Encodes a string to JavaScript/ECMAScript.
|
||||
* Encodes a String to JavaScript/ECMAScript.
|
||||
*
|
||||
* @param src the source string
|
||||
* @return the enocded string
|
||||
* @param src the source String
|
||||
* @return the encoded String
|
||||
*/
|
||||
public static String encodeJS(String src) {
|
||||
if (src == null || src.isBlank()) {
|
||||
|
|
|
@ -54,8 +54,8 @@ class TestEncode {
|
|||
@Test
|
||||
void testEncodeJson() {
|
||||
var t = TemplateFactory.JSON.get("encodeJson");
|
||||
t.setAttribute(TestCase.FOO, "fde\fde\rjk\tos\\u218Foi");
|
||||
assertThat(t.getContent()).isEqualTo("{\n \"foo\": \"fde\\fde\\rjk\\tos\\\\u218Foi\"\n}");
|
||||
t.setAttribute(TestCase.FOO, "This is a \"•test\"");
|
||||
assertThat(t.getContent()).isEqualTo("{\n \"foo\": \"This is a \\\"\\u2022test\\\"\"\n}");
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue