New to Telerik UI for ASP.NET MVC? Start a free 30-day trial

Defines the fluent API for configuring the EditorPasteCleanupSettings settings.

Definition

Namespace:Kendo.Mvc.UI.Fluent

Assembly:Kendo.Mvc.dll

Syntax:

C#
public class EditorPasteCleanupSettingsBuilder

Inheritance: objectEditorPasteCleanupSettingsBuilder

Inherited Members object.GetType()object.MemberwiseClone()object.ToString()object.Equals(object)object.Equals(object, object)object.ReferenceEquals(object, object)object.GetHashCode()...

Constructors

C#
public EditorPasteCleanupSettingsBuilder(EditorPasteCleanupSettings settings)
Parameters:settingsEditorPasteCleanupSettings

Methods

All HTML tags are stripped leaving only the text in the content.

C#
public EditorPasteCleanupSettingsBuilder All(bool value)
Parameters:valuebool

The value that enables the All option.

Returns:

EditorPasteCleanupSettingsBuilder

Example:
C#
@( Html.Kendo().Editor()
.Name("Editor")
.PasteCleanup(pasteCleanup => pasteCleanup.All(true))
)

Removes 'style' and 'class' attributes from the pasting content.

C#
public EditorPasteCleanupSettingsBuilder Css(bool value)
Parameters:valuebool

The value that enables the Css option.

Returns:

EditorPasteCleanupSettingsBuilder

Example:
C#
@( Html.Kendo().Editor()
.Name("Editor")
.PasteCleanup(pasteCleanup => pasteCleanup.Css(true))
)

Defines a callback function to integrate a custom implementation for cleaning up the paste content. Make sure the callback function always returns the result.

C#
public EditorPasteCleanupSettingsBuilder Custom(Func<object, object> handler)
Parameters:handlerFunc<object, object>

The handler code wrapped in a text tag (Razor syntax).

Returns:

EditorPasteCleanupSettingsBuilder

Example:
C#
@( Html.Kendo().Editor()
.Name("Editor")
.PasteCleanup(pasteCleanup =&gt; pasteCleanup.Custom(@&lt;text&gt;
function(html){
return html.replace(/&lt;img[^&gt;]*&gt;/, "");
}
&lt;/text&gt;)
)
)

Defines a callback function to integrate a custom implementation for cleaning up the paste content. Make sure the callback function always returns the result.

C#
public EditorPasteCleanupSettingsBuilder Custom(string handler)
Parameters:handlerstring

TThe name of the JavaScript function that will handle the event.

Returns:

EditorPasteCleanupSettingsBuilder

Example:
C#
@( Html.Kendo().Editor()
.Name("Editor")
.PasteCleanup(pasteCleanup =&gt; pasteCleanup.Custom("customCleanUp"))
)
&lt;script&gt;
function customCleanUp(html) {
return html.replace(/&lt;img[^&gt;]*&gt;/, "");
}
&lt;/script&gt;

Strip all HTML tags but keep new lines in the pasted content.

C#
public EditorPasteCleanupSettingsBuilder KeepNewLines(bool value)
Parameters:valuebool

The value that enables the KeepNewLines option.

Returns:

EditorPasteCleanupSettingsBuilder

Example:
C#
@( Html.Kendo().Editor()
.Name("Editor")
.PasteCleanup(pasteCleanup =&gt; pasteCleanup.KeepNewLines(true))
)

Remove all special formatting from MS Word content like font-name, font-size and MS Word specific tags.

C#
public EditorPasteCleanupSettingsBuilder MsAllFormatting(bool value)
Parameters:valuebool

The value that enables the MsAllFormatting option.

Returns:

EditorPasteCleanupSettingsBuilder

Example:
C#
@( Html.Kendo().Editor()
.Name("Editor")
.PasteCleanup(pasteCleanup =&gt; pasteCleanup.MsAllFormatting(true))
)

Converts MS Word pasted content into HTML lists.

C#
public EditorPasteCleanupSettingsBuilder MsConvertLists(bool value)
Parameters:valuebool

The value that enables the MsConvertLists option.

Returns:

EditorPasteCleanupSettingsBuilder

Example:
C#
@( Html.Kendo().Editor()
.Name("Editor")
.PasteCleanup(pasteCleanup =&gt; pasteCleanup.MsConvertLists(true))
)

Removes all MS Word specific tags and cleans up the extra metadata.

C#
public EditorPasteCleanupSettingsBuilder MsTags(bool value)
Parameters:valuebool

The value that enables the MsTags option.

Returns:

EditorPasteCleanupSettingsBuilder

Example:
C#
@( Html.Kendo().Editor()
.Name("Editor")
.PasteCleanup(pasteCleanup =&gt; pasteCleanup.MsTags(true))
)

Prevent any cleaning up of the content.

C#
public EditorPasteCleanupSettingsBuilder None(bool value)
Parameters:valuebool

The value that enables the None option.

Returns:

EditorPasteCleanupSettingsBuilder

Example:
C#
@( Html.Kendo().Editor()
.Name("Editor")
.PasteCleanup(pasteCleanup =&gt; pasteCleanup.None(true))
)

Remove all span elements from the content, ensuring much of the inline formatting is removed.

C#
public EditorPasteCleanupSettingsBuilder Span(bool value)
Parameters:valuebool

The value that enables the Span option.

Returns:

EditorPasteCleanupSettingsBuilder

Example:
C#
@( Html.Kendo().Editor()
.Name("Editor")
.PasteCleanup(pasteCleanup =&gt; pasteCleanup.Span(true))
)