Documentation
Cleaner
input #
html | String |
Returns: String
Clean the HTML string for the setting to the editor.
html = this.cleaner.input(html);
output #
html | String |
Returns: String
Clean the HTML string for the getting from the editor.
html = this.cleaner.output(html);
paste #
html | String |
Returns: String
Clean the pasted HTML string for the setting to the editor.
html = this.cleaner.paste(html);
pastePlainText #
html | String |
Returns: String
Clean the HTML string to the pasted plain text.
html = this.cleaner.pastePlainText(html);
paragraphize #
html | String |
Returns: String
Paragraphize the HTML string.
html = this.cleaner.paragraphize(html);
getFlatText #
html | String |
Returns: String
Get the plain text from the HTML string.
var text = this.cleaner.getFlatText(html);
replaceTags #
html | String | |
tags | Object |
Returns: String
Replace the specified tags in the HTML string.
var tags = {
b: strong,
i: em
};
html = this.cleaner.replaceTags(html, tags);
replaceNbspToSpaces #
html | String |
Returns: String
Replace nbsp
chars to spaces in the HTML string.
html = this.cleaner.replaceNbspToSpaces(html);
replaceBlocksToBr #
html | String |
Returns: String
Replace block tags to br
endings in the HTML string.
html = this.cleaner.replaceBlocksToBr(html);
cleanNewLines #
html | String |
Returns: String
Remove new lines in the HTML string.
html = this.cleaner.cleanNewLines(html);
cleanSpacesInPre #
html | String |
Returns: String
Replace nbsp
chars to spaces in the pre tags.
html = this.cleaner.cleanSpacesInPre(html);
removeInvisibleSpaces #
html | String |
Returns: String
Remove invisible spaces in the HTML string.
html = this.cleaner.removeInvisibleSpaces(html);
removeNl #
html | String |
Returns: String
Remove new lines in the HTML string.
html = this.cleaner.removeNl(html);
removeTags #
html | String | |
tags | Array |
Returns: String
Remove the specified tags in the HTML string.
html = this.cleaner.removeTags(html, ['h1', 'pre']);
removeTagsExcept #
html | String | |
tags | Array |
Returns: String
Remove all tags except the specified tags in the HTML string.
html = this.cleaner.removeTagsExcept(html, ['h1', 'p']);
removeComments #
html | String |
Returns: String
Remove comments in the HTML string.
html = this.cleaner.removeComments(html);
removeSpanWithoutAttributes #
html | String |
Returns: String
Remove empty spans (without attributes and content) in the HTML string.
html = this.cleaner.removeSpanWithoutAttributes(html);
removeEmptyAttributes #
html | String | |
attrs | Array |
Returns: String
Remove empty attributes of elements in the HTML string.
html = this.cleaner.removeEmptyAttributes(html, ['style', 'class']);
encodeHtml #
html | String |
Returns: String
Encode the HTML string.
html = this.cleaner.encodeHtml(html);
encodeEntities #
html | String |
Returns: String
Encode entities in the HTML string.
html = this.cleaner.encodeEntities(html);
decodeEntities #
html | String |
Returns: String
Decode entities in the HTML string.
html = this.cleaner.decodeEntities(html);