public class Escaping extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
ESCAPABLE |
static String |
ESCAPABLE_CHARS |
| Constructor and Description |
|---|
Escaping() |
| Modifier and Type | Method and Description |
|---|---|
static BasedSequence |
collapseWhitespace(BasedSequence s,
ReplacedTextMapper textMapper) |
static String |
collapseWhitespace(CharSequence s,
boolean trim)
Collapse regions of multiple white spaces to a single space
|
static BasedSequence |
escapeHtml(BasedSequence s,
boolean preserveEntities,
ReplacedTextMapper textMapper) |
static String |
escapeHtml(CharSequence s,
boolean preserveEntities) |
static BasedSequence |
normalizeEndWithEOL(BasedSequence s,
ReplacedTextMapper textMapper)
Normalize eol: embedded \r and \r\n are converted to \n
|
static String |
normalizeEndWithEOL(CharSequence s)
Normalize eol: embedded \r and \r\n are converted to \n
|
static BasedSequence |
normalizeEOL(BasedSequence s,
ReplacedTextMapper textMapper)
Normalize eol: embedded \r and \r\n are converted to \n
|
static BasedSequence |
normalizeEOL(BasedSequence s,
ReplacedTextMapper textMapper,
boolean endWithEOL)
Normalize eol: embedded \r and \r\n are converted to \n
|
static String |
normalizeEOL(CharSequence s)
Normalize eol: embedded \r and \r\n are converted to \n
|
static String |
normalizeEOL(CharSequence s,
boolean endWithEOL)
Normalize eol: embedded \r and \r\n are converted to \n
|
static String |
normalizeReference(CharSequence s,
boolean changeCase)
Normalize the link reference id
|
static String |
normalizeReferenceChars(CharSequence s,
boolean changeCase)
Get a normalized the link reference id from reference characters
|
static String |
obfuscate(String email,
boolean randomize)
e-mail obfuscation from pegdown
|
static String |
percentEncodeUrl(CharSequence s) |
static BasedSequence |
removeAll(BasedSequence s,
CharSequence remove,
ReplacedTextMapper textMapper)
Replace entities and backslash escapes with literal characters.
|
static BasedSequence |
unescape(BasedSequence s,
ReplacedTextMapper textMapper)
Replace entities and backslash escapes with literal characters.
|
static BasedSequence |
unescapeHtml(BasedSequence s,
ReplacedTextMapper textMapper)
Replace entities and backslash escapes with literal characters.
|
static String |
unescapeHtml(CharSequence s)
Replace entities and backslash escapes with literal characters.
|
static String |
unescapeString(CharSequence s)
Replace entities and backslash escapes with literal characters.
|
static String |
unescapeString(CharSequence s,
boolean unescapeEntities)
Replace entities and backslash escapes with literal characters.
|
public static final String ESCAPABLE_CHARS
public static final String ESCAPABLE
public static String escapeHtml(CharSequence s, boolean preserveEntities)
public static BasedSequence escapeHtml(BasedSequence s, boolean preserveEntities, ReplacedTextMapper textMapper)
public static String unescapeString(CharSequence s)
s - string to un-escapepublic static String unescapeString(CharSequence s, boolean unescapeEntities)
s - string to un-escapeunescapeEntities - true if HTML entities are to be unescapedpublic static BasedSequence unescape(BasedSequence s, ReplacedTextMapper textMapper)
s - based sequence to un-escapetextMapper - replaced text mapper to update for the changed textpublic static BasedSequence removeAll(BasedSequence s, CharSequence remove, ReplacedTextMapper textMapper)
s - sequence being changedremove - string to removetextMapper - replaced text mapper to update for the changed textpublic static String unescapeHtml(CharSequence s)
s - string to un-escapepublic static BasedSequence unescapeHtml(BasedSequence s, ReplacedTextMapper textMapper)
s - based sequence to un-escapetextMapper - replaced text mapper to update for the changed textpublic static String normalizeEndWithEOL(CharSequence s)
Append EOL sequence if sequence does not already end in EOL
s - sequence to convertpublic static String normalizeEOL(CharSequence s)
s - sequence to convertpublic static String normalizeEOL(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.public static BasedSequence normalizeEndWithEOL(BasedSequence s, ReplacedTextMapper textMapper)
Append EOL sequence if sequence does not already end in EOL
s - sequence to converttextMapper - text mapper to update for the replaced textpublic static BasedSequence normalizeEOL(BasedSequence s, ReplacedTextMapper textMapper)
s - sequence to converttextMapper - text mapper to update for the replaced textpublic static BasedSequence normalizeEOL(BasedSequence s, 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.public static String percentEncodeUrl(CharSequence s)
s - string to encodepublic static String normalizeReference(CharSequence s, boolean changeCase)
s - sequence containing the link reference idchangeCase - if true then reference will be converted to lowercasepublic static String obfuscate(String email, boolean randomize)
email - e-mail urlrandomize - true to randomize, false for testingpublic static String normalizeReferenceChars(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 lowercasepublic static String collapseWhitespace(CharSequence s, boolean trim)
s - sequence to processtrim - true if the sequence should also be trimmedpublic static BasedSequence collapseWhitespace(BasedSequence s, ReplacedTextMapper textMapper)
Copyright © 2019. All rights reserved.