public class Escaping extends Object
| Modifier and Type | Field and Description |
|---|---|
static @NotNull com.vladsch.flexmark.util.misc.CharPredicate |
AMP_BACKSLASH_SET |
static String |
ESCAPABLE |
static String |
ESCAPABLE_CHARS |
| Constructor and Description |
|---|
Escaping() |
| Modifier and Type | Method and Description |
|---|---|
static @NotNull BasedSequence |
collapseWhitespace(@NotNull BasedSequence s,
@NotNull ReplacedTextMapper textMapper) |
static @NotNull String |
collapseWhitespace(@NotNull CharSequence s,
boolean trim)
Collapse regions of multiple white spaces to a single space
|
static @NotNull BasedSequence |
escapeHtml(@NotNull BasedSequence s,
boolean preserveEntities,
@NotNull ReplacedTextMapper textMapper) |
static String |
escapeHtml(@NotNull CharSequence s,
boolean preserveEntities) |
static @NotNull BasedSequence |
normalizeEndWithEOL(@NotNull BasedSequence s,
@NotNull ReplacedTextMapper textMapper)
Normalize eol: embedded \r and \r\n are converted to \n
|
static @NotNull String |
normalizeEndWithEOL(@NotNull CharSequence s)
Normalize eol: embedded \r and \r\n are converted to \n
|
static @NotNull BasedSequence |
normalizeEOL(@NotNull BasedSequence s,
@NotNull ReplacedTextMapper textMapper)
Normalize eol: embedded \r and \r\n are converted to \n
|
static @NotNull BasedSequence |
normalizeEOL(@NotNull BasedSequence s,
@NotNull ReplacedTextMapper textMapper,
boolean endWithEOL)
Normalize eol: embedded \r and \r\n are converted to \n
|
static @NotNull String |
normalizeEOL(@NotNull CharSequence s)
Normalize eol: embedded \r and \r\n are converted to \n
|
static @NotNull String |
normalizeEOL(@NotNull CharSequence s,
boolean endWithEOL)
Normalize eol: embedded \r and \r\n are converted to \n
|
static @NotNull String |
normalizeReference(@NotNull CharSequence s,
boolean changeCase)
Normalize the link reference id
|
static @NotNull String |
normalizeReferenceChars(@NotNull CharSequence s,
boolean changeCase)
Get a normalized the link reference id from reference characters
|
static @NotNull String |
obfuscate(@NotNull String email,
boolean randomize)
e-mail obfuscation from pegdown
|
static @NotNull BasedSequence |
percentDecodeUrl(@NotNull BasedSequence s,
@NotNull ReplacedTextMapper textMapper) |
static @NotNull String |
percentDecodeUrl(@NotNull CharSequence s) |
static @NotNull BasedSequence |
percentEncodeUrl(@NotNull BasedSequence s,
@NotNull ReplacedTextMapper textMapper) |
static @NotNull String |
percentEncodeUrl(@NotNull CharSequence s) |
static @NotNull BasedSequence |
removeAll(@NotNull BasedSequence s,
@NotNull CharSequence remove,
@NotNull ReplacedTextMapper textMapper)
Replace entities and backslash escapes with literal characters.
|
static @NotNull BasedSequence |
unescape(@NotNull BasedSequence s,
@NotNull ReplacedTextMapper textMapper)
Replace entities and backslash escapes with literal characters.
|
static @NotNull BasedSequence |
unescapeHtml(@NotNull BasedSequence s,
@NotNull List<Range> ranges,
@NotNull ReplacedTextMapper textMapper)
Replace entities and backslash escapes with literal characters.
|
static @NotNull BasedSequence |
unescapeHtml(@NotNull BasedSequence s,
@NotNull ReplacedTextMapper textMapper)
Replace entities and backslash escapes with literal characters.
|
static @NotNull String |
unescapeHtml(@NotNull CharSequence s)
Replace entities and backslash escapes with literal characters.
|
static @NotNull String |
unescapeString(@NotNull CharSequence s)
Replace entities and backslash escapes with literal characters.
|
static @NotNull String |
unescapeString(@NotNull CharSequence s,
boolean unescapeEntities)
Replace entities and backslash escapes with literal characters.
|
public static final String ESCAPABLE_CHARS
public static final String ESCAPABLE
@NotNull public static final @NotNull com.vladsch.flexmark.util.misc.CharPredicate AMP_BACKSLASH_SET
public static String escapeHtml(@NotNull @NotNull CharSequence s, boolean preserveEntities)
@NotNull public static @NotNull BasedSequence escapeHtml(@NotNull @NotNull BasedSequence s, boolean preserveEntities, @NotNull @NotNull ReplacedTextMapper textMapper)
@NotNull public static @NotNull String unescapeString(@NotNull @NotNull CharSequence s)
s - string to un-escape@NotNull public static @NotNull String unescapeString(@NotNull @NotNull CharSequence s, boolean unescapeEntities)
s - string to un-escapeunescapeEntities - true if HTML entities are to be unescaped@NotNull public static @NotNull BasedSequence unescape(@NotNull @NotNull BasedSequence s, @NotNull @NotNull ReplacedTextMapper textMapper)
s - based sequence to un-escapetextMapper - replaced text mapper to update for the changed text@NotNull public static @NotNull BasedSequence removeAll(@NotNull @NotNull BasedSequence s, @NotNull @NotNull CharSequence remove, @NotNull @NotNull ReplacedTextMapper textMapper)
s - sequence being changedremove - string to removetextMapper - replaced text mapper to update for the changed text@NotNull public static @NotNull String unescapeHtml(@NotNull @NotNull CharSequence s)
s - string to un-escape@NotNull public static @NotNull BasedSequence unescapeHtml(@NotNull @NotNull BasedSequence s, @NotNull @NotNull ReplacedTextMapper textMapper)
s - based sequence to un-escapetextMapper - replaced text mapper to update for the changed text@NotNull public static @NotNull BasedSequence unescapeHtml(@NotNull @NotNull BasedSequence s, @NotNull @NotNull List<Range> ranges, @NotNull @NotNull ReplacedTextMapper textMapper)
s - based sequence to un-escapetextMapper - replaced text mapper to update for the changed text@NotNull public static @NotNull String normalizeEndWithEOL(@NotNull @NotNull CharSequence s)
Append EOL sequence if sequence does not already end in EOL
s - sequence to convert@NotNull public static @NotNull String normalizeEOL(@NotNull @NotNull CharSequence s)
s - sequence to convert@NotNull public static @NotNull String normalizeEOL(@NotNull @NotNull CharSequence s, boolean endWithEOL)
s - sequence to convertendWithEOL - true if an EOL is to be appended to the end of the sequence if not already ending with one.@NotNull public static @NotNull BasedSequence normalizeEndWithEOL(@NotNull @NotNull BasedSequence s, @NotNull @NotNull ReplacedTextMapper textMapper)
Append EOL sequence if sequence does not already end in EOL
s - sequence to converttextMapper - text mapper to update for the replaced text@NotNull public static @NotNull BasedSequence normalizeEOL(@NotNull @NotNull BasedSequence s, @NotNull @NotNull ReplacedTextMapper textMapper)
s - sequence to converttextMapper - text mapper to update for the replaced text@NotNull public static @NotNull BasedSequence normalizeEOL(@NotNull @NotNull BasedSequence s, @NotNull @NotNull ReplacedTextMapper textMapper, boolean endWithEOL)
Append EOL sequence if sequence does not already end in EOL
s - sequence to converttextMapper - text mapper to update for the replaced textendWithEOL - whether an EOL is to be appended to the end of the sequence if it does not already end with one.@NotNull public static @NotNull String percentEncodeUrl(@NotNull @NotNull CharSequence s)
s - string to encode@NotNull public static @NotNull BasedSequence percentEncodeUrl(@NotNull @NotNull BasedSequence s, @NotNull @NotNull ReplacedTextMapper textMapper)
s - string to encodetextMapper - text mapper to update for the replaced text@NotNull public static @NotNull String percentDecodeUrl(@NotNull @NotNull CharSequence s)
s - string to encode@NotNull public static @NotNull BasedSequence percentDecodeUrl(@NotNull @NotNull BasedSequence s, @NotNull @NotNull ReplacedTextMapper textMapper)
s - string to encodetextMapper - text mapper to update for the replaced text@NotNull public static @NotNull String normalizeReference(@NotNull @NotNull CharSequence s, boolean changeCase)
s - sequence containing the link reference idchangeCase - if true then reference will be converted to lowercase@NotNull public static @NotNull String obfuscate(@NotNull @NotNull String email, boolean randomize)
email - e-mail urlrandomize - true to randomize, false for testing@NotNull public static @NotNull String normalizeReferenceChars(@NotNull @NotNull CharSequence s, boolean changeCase)
Will remove leading ![ or [ and trailing ], collapse multiple whitespaces to a space and optionally convert the id to lowercase.
s - sequence containing the link reference idchangeCase - if true then reference will be converted to lowercase@NotNull public static @NotNull String collapseWhitespace(@NotNull @NotNull CharSequence s, boolean trim)
s - sequence to processtrim - true if the sequence should also be trimmed@NotNull public static @NotNull BasedSequence collapseWhitespace(@NotNull @NotNull BasedSequence s, @NotNull @NotNull ReplacedTextMapper textMapper)
Copyright © 2020. All rights reserved.