@progress/kendo-angular-editor
Version:
Kendo UI Editor for Angular
65 lines (64 loc) • 2.41 kB
TypeScript
/**-----------------------------------------------------------------------------------------
* Copyright © 2025 Progress Software Corporation. All rights reserved.
* Licensed under commercial license. See LICENSE.md in the project root for more information
*-------------------------------------------------------------------------------------------*/
/**
* Represents the configuration options for Paste Cleanup ([see example]({% slug paste_cleanup %})).
*
* @example
* ```typescript
* const settings: PasteCleanupSettings = {
* convertMsLists: true,
* removeHtmlComments: true,
* stripTags: ['span'],
* removeAttributes: ['lang'],
* removeMsClasses: true,
* removeMsStyles: true,
* removeInvalidHTML: true
* };
* ```
*/
export interface PasteCleanupSettings {
/**
* Converts MS Word lists to HTML lists when set to `true`.
*/
convertMsLists?: boolean;
/**
* Removes HTML comments when set to `true`.
*
* For example, `<!-- comment --> <p> content </p>` becomes `<p> content </p>`.
*/
removeHtmlComments?: boolean;
/**
* Removes the specified tags from the HTML.
*
* For example, with `stripTags: ['span']`, `<p><span lang=EN-US>content</span></p>` becomes `<p>content</p>`.
*/
stripTags?: string[];
/**
* Removes the specified DOM attributes from the HTML.
* Set to `'all'` to remove every attribute.
* Set to an array to remove specific attributes.
*
* For example, with `removeAttributes: ['lang']`, `<p><span lang=EN-US>content</span></p>` becomes `<p><span>content</span></p>`.
*/
removeAttributes?: string[] | 'all';
/**
* Removes class attributes starting with 'Mso' when set to `true`.
*
* For example, `<p class="MsoNormal">pasted from MS Word</p>` becomes `<p>pasted from MS Word</p>`.
*/
removeMsClasses?: boolean;
/**
* Removes style attributes starting with 'Mso' when set to `true`.
*
* For example, `<p><span style="color:#7C7C7C; mso-themecolor:accent3; mso-themeshade:191;">content</span></p>` becomes `<p><span style="color: #7C7C7C; background: silver;">content</span></p>`.
*/
removeMsStyles?: boolean;
/**
* Removes invalid HTML when set to `true`.
*
* For example, `<p>content <o:p>, <w:sdtPr></p>` becomes `<p>content </p>`.
*/
removeInvalidHTML?: boolean;
}