public class TextCleaner extends Object
Constructor and Description |
---|
TextCleaner(Options options)
Create a new TextCleaner based on the configured options.
|
Modifier and Type | Method and Description |
---|---|
String |
clean(Object input)
Clean the given input text based on the original configuration Options.
|
String |
cleanCode(Object input)
Clean the given input text based on the original configuration Options.
|
String |
cleanInlineCode(Object input)
Method to clean inline code, and, if necessary, add spaces to make sure that internal, leading, or
trailing
'`' characters don't break the inline code. |
String |
cleanUrl(String input)
Handles escaping special characters in URLs to avoid issues when they are rendered out
(ie: spaces, parentheses)
|
String |
unescapeLeadingCharacters(String input)
Removes the escaping on leading characters, for example, when they are going to be rendered inside
another node, such as a table.
|
public TextCleaner(Options options)
options
- Options that will affect what is cleaned.public String clean(Object input)
input
- The text to be cleaned. Can be any object. JSoup nodes are handled specially.public String cleanCode(Object input)
input
- The text to be cleaned. Can be any object. JSoup nodes are handled specially.public String cleanInlineCode(Object input)
'`'
characters don't break the inline code.
Newlines are also replaced with spaces.
This method also adds the leading and trailing '`'
or '```'
as necessary.input
- String to clean. Can be any object. JSoup nodes are handled specially.public String unescapeLeadingCharacters(String input)
input
- String to processCopyright © 2017. All rights reserved.