Type: Boolean
Default: true
This setting allows you to turn off all the cleaning rules for pasted content.
Redactor('#entry', {
paste: {
clean: false
}
});
Type: Boolean
Default: true
This setting turns off the default conversion of text URLs into clickable links and image URLs to the image block.
Redactor('#entry', {
paste: {
autoparse: false
}
});
Type: Boolean
Default: false
Sometimes you just need to restrict content that can be pasted into Redactor. When turned on, this setting will remove all tags and formatting from pasted text, excluding links and images.
Redactor('#entry', {
paste: {
plaintext: true
}
});
Type: Boolean
Default: true
This setting tells the editor to remove all attributes in all tags except a
and img
in the pasted content.
Redactor('#entry', {
paste: {
stripAttr: true
}
});
Type: Boolean
Default: true
Whenever you need to exclude images from the content that users can paste, this setting is here for you, just set it to false.
Redactor('#entry', {
paste: {
images: false
}
});
Type: Boolean
Default: true
If you need to restrict the content that users can paste into Redactor X, but only need to exclude links, set it to false
, and all links will be pasted as plain text.
Redactor('#entry', {
paste: {
links: false
}
});
Type: Array
Default: array
Whenever you need to control which block tags your users can paste, use this setting. Tweak this default list to better fit your needs, but keep in mind, you can only remove block tags from the list, not add them.
Redactor('#entry', {
paste: {
blockTags: ['blockquote', 'p']
}
});
If you'd like to completely restrict any block tags from being pasted, just use this setting with an empty array of tags.
Redactor('#entry', {
paste: {
blockTags: []
}
});
Type: Array
Default: array
Whenever you need to control which inline tags your users can paste, use this setting. Tweak this default list to better fit your needs, but keep in mind, you can only remove inline tags from the list, not add them.
Redactor('#entry', {
paste: {
inlineTags: ['a', 'br', 'strong', 'ins', 'code', 'del']
}
});
If you'd like to completely restrict any inline tags from being pasted, just use this setting with an empty array of tags.
Redactor('#entry', {
paste: {
inlineTags: []
}
});
Type: Array
Default: array
Whenever you need to control which form tags your users can paste, use this setting. Tweak this default list to better fit your needs, but keep in mind, you can only remove form tags from the list, not add them.
Redactor('#entry', {
paste: {
formTags: ['button', 'input']
}
});
If you'd like to completely restrict any form tags from being pasted, just use this setting with an empty array of tags.
Redactor('#entry', {
paste: {
formTags: []
}
});
Type: Boolean
Default: false
Sets a flag so that the id attribute of links is not removed when content is pasted.
Redactor('#entry', {
paste: {
keepIdAttr: true
}
});
Type: Boolean
Default: false
Sets a flag so that the name attribute is not removed from elements when content are pasted from Word.
Redactor('#entry', {
paste: {
keepNameAttr: true
}
});
Type: Array
Default: []
This setting allows you to set an array of tags for which the class attribute will not be deleted on pasting.
Redactor('#entry', {
paste: {
keepClass: ['p', 'td']
}
});
Type: Array
Default: ['td', 'th']
This setting allows you to set an array of tags for which attributes (excluding class and style) will not be deleted on pasting.
Redactor('#entry', {
paste: {
keepAttrs: ['td', 'th', 'p']
}
});
Type: Object
Default: empty
With this setting, you can specify at pasting that the editor retain certain styles of pasted content from MS Word.
It is important to turn off the stripAttr
setting for this option to work.
Redactor('#entry', {
paste: {
stripAttr: false,
keepWordFormatting: {
styles: ['color', 'background']
}
}
});
Type: Boolean
Default: false
This setting formats the pasted plain text into paragraphs.
Redactor('#entry', {
paste: {
paragraphizeLines: true
}
});