public final class HtmlUtil
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
escapeForHtml(java.lang.String s,
java.lang.String newlineReplacement,
boolean inPreBlock)
Returns a string with characters that are special to HTML (such as
< , > and & ) replaced
by their HTML escape sequences. |
static java.lang.String |
getHexString(java.awt.Color c)
Returns a hex string for the specified color, suitable for HTML.
|
static java.lang.String |
getTextAsHtml(RSyntaxTextArea textArea,
int start,
int end) |
public static java.lang.String escapeForHtml(java.lang.String s, java.lang.String newlineReplacement, boolean inPreBlock)
<
, >
and &
) replaced
by their HTML escape sequences.s
- The input string.newlineReplacement
- What to replace newline characters with.
If this is null
, they are simply removed.inPreBlock
- Whether this HTML will be in within pre
tags. If this is true
, spaces will be kept as-is;
otherwise, they will be converted to "
".s
.public static java.lang.String getHexString(java.awt.Color c)
c
- The color.#rrggbb
",
or null
if c
is null
.public static java.lang.String getTextAsHtml(RSyntaxTextArea textArea, int start, int end)