Documentation

Cleaner

input

Arguments
html String

Returns: String

Clean the HTML string for the setting to the editor.

html = this.cleaner.input(html);

output

Arguments
html String

Returns: String

Clean the HTML string for the getting from the editor.

html = this.cleaner.output(html);

paste

Arguments
html String

Returns: String

Clean the pasted HTML string for the setting to the editor.

html = this.cleaner.paste(html);

pastePlainText

Arguments
html String

Returns: String

Clean the HTML string to the pasted plain text.

html = this.cleaner.pastePlainText(html);

paragraphize

Arguments
html String

Returns: String

Paragraphize the HTML string.

html = this.cleaner.paragraphize(html);

getFlatText

Arguments
html String

Returns: String

Get the plain text from the HTML string.

var text = this.cleaner.getFlatText(html);

replaceTags

Arguments
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

Arguments
html String

Returns: String

Replace nbsp chars to spaces in the HTML string.

html = this.cleaner.replaceNbspToSpaces(html);

replaceBlocksToBr

Arguments
html String

Returns: String

Replace block tags to br endings in the HTML string.

html = this.cleaner.replaceBlocksToBr(html);

cleanNewLines

Arguments
html String

Returns: String

Remove new lines in the HTML string.

html = this.cleaner.cleanNewLines(html);

cleanSpacesInPre

Arguments
html String

Returns: String

Replace nbsp chars to spaces in the pre tags.

html = this.cleaner.cleanSpacesInPre(html);

removeInvisibleSpaces

Arguments
html String

Returns: String

Remove invisible spaces in the HTML string.

html = this.cleaner.removeInvisibleSpaces(html);

removeNl

Arguments
html String

Returns: String

Remove new lines in the HTML string.

html = this.cleaner.removeNl(html);

removeTags

Arguments
html String
tags Array

Returns: String

Remove the specified tags in the HTML string.

html = this.cleaner.removeTags(html, ['h1', 'pre']);

removeTagsExcept

Arguments
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

Arguments
html String

Returns: String

Remove comments in the HTML string.

html = this.cleaner.removeComments(html);

removeSpanWithoutAttributes

Arguments
html String

Returns: String

Remove empty spans (without attributes and content) in the HTML string.

html = this.cleaner.removeSpanWithoutAttributes(html);

removeEmptyAttributes

Arguments
html String
attrs Array

Returns: String

Remove empty attributes of elements in the HTML string.

html = this.cleaner.removeEmptyAttributes(html, ['style', 'class']);

encodeHtml

Arguments
html String

Returns: String

Encode the HTML string.

html = this.cleaner.encodeHtml(html);

encodeEntities

Arguments
html String

Returns: String

Encode entities in the HTML string.

html = this.cleaner.encodeEntities(html);

decodeEntities

Arguments
html String

Returns: String

Decode entities in the HTML string.

html = this.cleaner.decodeEntities(html);