Class HtmlUtil
java.lang.Object
org.fife.ui.rsyntaxtextarea.HtmlUtil
Utility methods useful when generating HTML representations of RSTA content.
-
Constructor Summary
Constructors -
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.static StringgetTextAsHtml(RSyntaxTextArea textArea, int start, int end) Returns text from a text area as HTML.
-
Constructor Details
-
HtmlUtil
private HtmlUtil()
-
-
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
-
getTextAsHtml
Returns text from a text area as HTML. Markup is added so that the HTML represents the syntax highlighting in the editor.- Parameters:
textArea- The text area.start- The start offset.end- The end offset.- Returns:
- The HTML.
-