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
This commit is contained in:
Raph Levien
2015-07-10 17:11:39 -07:00
parent 77cae7869d
commit c55277d689

View File

@@ -137,7 +137,12 @@ public class Html {
}
/**
* 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();