/*! * Jodit Editor (https://xdsoft.net/jodit/) * Released under MIT see LICENSE.txt in the project root for license information. * Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net */ /** * @module plugins/clean-html */ import type { HTMLTagNames, IDictionary, Nullable } from "../../types/index"; declare module 'jodit/config' { interface Config { cleanHTML: { timeout: number; /** * Replace   to plain space */ replaceNBSP: boolean; /** * Remove empty P tags, if they are not in the beginning of the text */ fillEmptyParagraph: boolean; /** * Remove empty elements */ removeEmptyElements: boolean; /** * Replace old tags to new eg. to , to */ replaceOldTags: IDictionary | false; /** * You can use an iframe with the sandbox attribute to safely paste and test HTML code. * It prevents scripts and handlers from running, but it does slow things down. * * ```javascript * Jodit.make('#editor', { * cleanHTML: { * useIframeSandbox: true * } * }); * ``` */ useIframeSandbox: boolean; /** * @deprecated Use `removeEventAttributes` instead * Remove onError attributes */ removeOnError: boolean; /** * Remove all `on*` event handler attributes (onerror, onclick, onload, onmouseover, etc.) * When enabled, this replaces the legacy `removeOnError` behavior with comprehensive protection. * * ```javascript * Jodit.make('#editor', { * cleanHTML: { * removeEventAttributes: true * } * }); * ``` */ removeEventAttributes: boolean; /** * Safe href="javascript:" links */ safeJavaScriptLink: boolean; /** * Automatically add `rel="noopener noreferrer"` to links with `target="_blank"` * * ```javascript * Jodit.make('#editor', { * cleanHTML: { * safeLinksTarget: true * } * }); * ``` */ safeLinksTarget: boolean; /** * Whitelist of allowed CSS properties inside `style` attributes. * If set, all CSS properties not in the list will be removed. * * ```javascript * Jodit.make('#editor', { * cleanHTML: { * allowedStyles: { * '*': ['color', 'background-color', 'font-size', 'text-align'], * img: ['width', 'height'] * } * } * }); * ``` */ allowedStyles: false | IDictionary; /** * Custom sanitizer function. Called after Jodit's built-in sanitization. * Use this to integrate DOMPurify or other external sanitizers. * * ```javascript * import DOMPurify from 'dompurify'; * * Jodit.make('#editor', { * cleanHTML: { * sanitizer: (html) => DOMPurify.sanitize(html) * } * }); * ``` */ sanitizer: false | ((value: string) => string); /** * Automatically add `sandbox=""` attribute to all `