EditorPasteCleanupSettingsBuilder
Methods
All(System.Boolean)
All HTML tags are stripped leaving only the text in the content.
Parameters
value - System.Boolean
The value that enables the All option.
Example
@( Html.Kendo().Editor()
.Name("Editor")
.PasteCleanup(pasteCleanup => pasteCleanup.All(true))
)
Css(System.Boolean)
Removes 'style' and 'class' attributes from the pasting content.
Parameters
value - System.Boolean
The value that enables the Css option.
Example
@( Html.Kendo().Editor()
.Name("Editor")
.PasteCleanup(pasteCleanup => pasteCleanup.Css(true))
)
Custom(System.Func)
Defines a callback function to integrate a custom implementation for cleaning up the paste content. Make sure the callback function always returns the result.
Parameters
handler - System.Func<Object,Object>
The handler code wrapped in a text tag (Razor syntax).
Example
@( Html.Kendo().Editor()
.Name("Editor")
.PasteCleanup(pasteCleanup => pasteCleanup.Custom(@<text>
function(html){
return html.replace(/<img[^>]*>/, "");
}
</text>)
)
)
Custom(System.String)
Defines a callback function to integrate a custom implementation for cleaning up the paste content. Make sure the callback function always returns the result.
Parameters
handler - System.String
TThe name of the JavaScript function that will handle the event.
Example
@( Html.Kendo().Editor()
.Name("Editor")
.PasteCleanup(pasteCleanup => pasteCleanup.Custom("customCleanUp"))
)
<script>
function customCleanUp(html) {
return html.replace(/<img[^>]*>/, "");
}
</script>
KeepNewLines(System.Boolean)
Strip all HTML tags but keep new lines in the pasted content.
Parameters
value - System.Boolean
The value that enables the KeepNewLines option.
Example
@( Html.Kendo().Editor()
.Name("Editor")
.PasteCleanup(pasteCleanup => pasteCleanup.KeepNewLines(true))
)
MsAllFormatting(System.Boolean)
Remove all special formatting from MS Word content like font-name, font-size and MS Word specific tags.
Parameters
value - System.Boolean
The value that enables the MsAllFormatting option.
Example
@( Html.Kendo().Editor()
.Name("Editor")
.PasteCleanup(pasteCleanup => pasteCleanup.MsAllFormatting(true))
)
MsConvertLists(System.Boolean)
Converts MS Word pasted content into HTML lists.
Parameters
value - System.Boolean
The value that enables the MsConvertLists option.
Example
@( Html.Kendo().Editor()
.Name("Editor")
.PasteCleanup(pasteCleanup => pasteCleanup.MsConvertLists(true))
)
MsTags(System.Boolean)
Removes all MS Word specific tags and cleans up the extra metadata.
Parameters
value - System.Boolean
The value that enables the MsTags option.
Example
@( Html.Kendo().Editor()
.Name("Editor")
.PasteCleanup(pasteCleanup => pasteCleanup.MsTags(true))
)
None(System.Boolean)
Prevent any cleaning up of the content.
Parameters
value - System.Boolean
The value that enables the None option.
Example
@( Html.Kendo().Editor()
.Name("Editor")
.PasteCleanup(pasteCleanup => pasteCleanup.None(true))
)
Span(System.Boolean)
Remove all span elements from the content, ensuring much of the inline formatting is removed.
Parameters
value - System.Boolean
The value that enables the Span option.
Example
@( Html.Kendo().Editor()
.Name("Editor")
.PasteCleanup(pasteCleanup => pasteCleanup.Span(true))
)