java.lang.Object
de.grogra.pf.ui.autocomplete.impl.HtmlUtil
Utility methods useful when generating HTML representations of RSTA content.
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringescapeForHtml(String s, String newlineReplacement, boolean inPreBlock) Returns a string with characters that are special to HTML (such as<,>and&) replaced by their HTML escape sequences.static StringReturns a hex string for the specified color, suitable for HTML.
-
Method Details
-
escapeForHtml
Returns a string with characters that are special to HTML (such as<,>and&) replaced by their HTML escape sequences.- Parameters:
s- The input string.newlineReplacement- What to replace newline characters with. If this isnull, they are simply removed.inPreBlock- Whether this HTML will be in withinpretags. If this istrue, spaces will be kept as-is; otherwise, they will be converted to "".- Returns:
- The escaped version of
s.
-
getHexString
Returns a hex string for the specified color, suitable for HTML.- Parameters:
c- The color.- Returns:
- The string representation, in the form "
#rrggbb", ornullifcisnull.
-