Improve Html.toHtml() documentation
The existing documentation is very terse and users were getting
confused whether the method escapes HTML metacharacters or not. Expand
the description a bit and explicitly state that metacharacters are
escaped.
Bug: 17456925
Change-Id: Icaae7fe1344629de5c0860674f3913781de18013
diff --git a/core/java/android/text/Html.java b/core/java/android/text/Html.java
index a55a08c..dc1d6f6 100644
--- a/core/java/android/text/Html.java
+++ b/core/java/android/text/Html.java
@@ -137,7 +137,12 @@
}
/**
- * Returns an HTML representation of the provided Spanned text.
+ * Returns an HTML representation of the provided Spanned text. A best effort is
+ * made to add HTML tags corresponding to spans. Also note that HTML metacharacters
+ * (such as "<" and "&") within the input text are escaped.
+ *
+ * @param text input text to convert
+ * @return string containing input converted to HTML
*/
public static String toHtml(Spanned text) {
StringBuilder out = new StringBuilder();