Documentation
Clean
cleanOnEnter
Type: Boolean
Default: true
This setting removes the attributes class
and style
inherited from the previous tag. You can turn it off:
$R('#content', {
cleanOnEnter: false
});
cleanInlineOnEnter
This setting keeps the inline tags (with styles) in the next line when the user presses enter key.
Type: Boolean
Default: false
$R('#content', {
cleanInlineOnEnter: true
});
removeScript
Type: Boolean
Default: true
This setting removes the script
tag in the Redactor source. To keep script
tag turn off this option:
$R('#content', {
removeScript: false
});
removeNewLines
Type: Boolean
Default: false
This setting removes all new lines between tags in the Redactor source code.
$R('#content', {
removeNewLines: true
});
removeComments
Type: Boolean
Default: true
To prevent Redactor from removing HTML comments, set this to false
.
$R('#content', {
removeComments: false
});
replaceTags
Type: Object
Boolean
Default: object
By default, the following is set to happen: 'b', 'i', and 'strike' tags are replaced by 'strong', 'em', and 'del' tags respectively:
{
'b': 'strong',
'i': 'em',
'strike': 'del'
}
To prevent this completely, just set replaceTags: false.
$R('#content', {
replaceTags: false
});
This setting is customizable. You could have your set of tag replacement rules, for instance:
$R('#content', {
replaceTags: {
'strong': 'mark',
'i': 'em'
}
});
This setting works with all tags, which are allowed in Redactor.