Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c55277d6 authored by Raph Levien's avatar Raph Levien
Browse files

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
parent 77cae786
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -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();