This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-lang.git
The following commit(s) were added to refs/heads/master by this push:
new ccb13fb58 Javadoc
ccb13fb58 is described below
commit ccb13fb58cd63b3b30632630251e6040741cc9ce
Author: Gary Gregory <[email protected]>
AuthorDate: Wed Dec 11 16:54:03 2024 -0500
Javadoc
---
.../apache/commons/lang3/StringEscapeUtils.java | 46 +++++++++++++++-------
1 file changed, 32 insertions(+), 14 deletions(-)
diff --git a/src/main/java/org/apache/commons/lang3/StringEscapeUtils.java
b/src/main/java/org/apache/commons/lang3/StringEscapeUtils.java
index a7828687e..0d2131d51 100644
--- a/src/main/java/org/apache/commons/lang3/StringEscapeUtils.java
+++ b/src/main/java/org/apache/commons/lang3/StringEscapeUtils.java
@@ -584,28 +584,46 @@ public class StringEscapeUtils {
/**
* Escapes the characters in a {@link String} using XML entities.
+ * <p>
+ * For example:
+ * </p>
*
- * <p>For example: {@code "bread" & "butter"} =>
- * {@code "bread" & "butter"}.
+ * <pre>{@code
+ * "bread" & "butter"
+ * }</pre>
+ * <p>
+ * converts to:
* </p>
*
- * <p>Note that XML 1.0 is a text-only format: it cannot represent control
- * characters or unpaired Unicode surrogate code points, even after
escaping.
- * {@code escapeXml10} will remove characters that do not fit in the
- * following ranges:</p>
+ * <pre>
+ * {@code
+ * "bread" & "butter"
+ * }
+ * </pre>
+ *
+ * <p>
+ * Note that XML 1.0 is a text-only format: it cannot represent control
characters or unpaired Unicode surrogate code points, even after escaping. The
+ * method {@code escapeXml10} will remove characters that do not fit in
the following ranges:
+ * </p>
*
- * <p>{@code #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD] |
[#x10000-#x10FFFF]}</p>
+ * <p>
+ * {@code #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD] |
[#x10000-#x10FFFF]}
+ * </p>
*
- * <p>Though not strictly necessary, {@code escapeXml10} will escape
- * characters in the following ranges:</p>
+ * <p>
+ * Though not strictly necessary, {@code escapeXml10} will escape
characters in the following ranges:
+ * </p>
*
- * <p>{@code [#x7F-#x84] | [#x86-#x9F]}</p>
+ * <p>
+ * {@code [#x7F-#x84] | [#x86-#x9F]}
+ * </p>
*
- * <p>The returned string can be inserted into a valid XML 1.0 or XML 1.1
- * document. If you want to allow more non-text characters in an XML 1.1
- * document, use {@link #escapeXml11(String)}.</p>
+ * <p>
+ * The returned string can be inserted into a valid XML 1.0 or XML 1.1
document. If you want to allow more non-text characters in an XML 1.1 document,
use
+ * {@link #escapeXml11(String)}.
+ * </p>
*
- * @param input the {@link String} to escape, may be null
+ * @param input the {@link String} to escape, may be null
* @return a new escaped {@link String}, {@code null} if null string input
* @see #unescapeXml(String)
* @since 3.3