You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by kw...@apache.org on 2026/05/11 16:29:14 UTC
(maven-doxia) 01/01: Restore some methods from Doxia 1.4
This is an automated email from the ASF dual-hosted git repository.
kwin pushed a commit to branch bugfix/restore-partial-binary-compatibility-with-1.4
in repository https://gitbox.apache.org/repos/asf/maven-doxia.git
commit 1a037e971832ba0fbc8838e4b29c73f046bd9701
Author: Konrad Windszus <kw...@apache.org>
AuthorDate: Mon May 11 18:29:06 2026 +0200
Restore some methods from Doxia 1.4
However mark them as deprecate and call the proper ones in the body.
This closes #1054
---
.../org/apache/maven/doxia/util/HtmlTools.java | 33 ++++++++++++++++++++++
1 file changed, 33 insertions(+)
diff --git a/doxia-core/src/main/java/org/apache/maven/doxia/util/HtmlTools.java b/doxia-core/src/main/java/org/apache/maven/doxia/util/HtmlTools.java
index 9733b5ea..55bbeb3a 100644
--- a/doxia-core/src/main/java/org/apache/maven/doxia/util/HtmlTools.java
+++ b/doxia-core/src/main/java/org/apache/maven/doxia/util/HtmlTools.java
@@ -413,6 +413,39 @@ public class HtmlTools {
return encoded.toString();
}
+ /**
+ * Construct a valid id.
+ *
+ * <p>
+ * <b>Note</b>: this method is identical to
+ * {@link DoxiaUtils#encodeId(String)},
+ * the rules to encode an id are laid out there.
+ * </p>
+ *
+ * @param id The id to be encoded.
+ * @return The trimmed and encoded id, or null if id is null, empty or blank.
+ * @see DoxiaUtils#encodeId(java.lang.String)
+ * @deprecated use {@link DoxiaUtils#encodeId(String)}
+ */
+ @Deprecated
+ public static String encodeId(String id) {
+ return DoxiaUtils.encodeId(id);
+ }
+
+ /**
+ * Determines if the specified text is a valid id according to the rules
+ * laid out in {@link #encodeId(String)}.
+ *
+ * @param text The text to be tested.
+ * @return <code>true</code> if the text is a valid id, otherwise <code>false</code>.
+ * @see DoxiaUtils#isValidId(String)
+ * @deprecated use {@link DoxiaUtils#isValidId(String)}
+ */
+ @Deprecated
+ public static boolean isId(String text) {
+ return DoxiaUtils.isValidId(text);
+ }
+
private HtmlTools() {
// utility class
}