mirror of
https://github.com/codex-team/editor.js
synced 2024-05-22 16:26:52 +02:00
f659015be6
* event handlers function added * santization config added * integrate with paste event * lint removed * remove old changes * object based sanitization configuration support * paste config updated * logic updated * extract tag name from paste-config * tool tags added * multi tag sanitization added * the comments added * lint removed * Update types/configs/paste-config.d.ts Co-authored-by: Peter Savchenko <specc.dev@gmail.com> * update the changes * lint removed\ * return empty array by get tags * submoduble reset * Update src/components/modules/paste.ts Co-authored-by: Jorge <46056498+jorgectf@users.noreply.github.com> * changelog added * tool comments added * chore: docs, code comments updated * fix: xss in processDataTransfer * base tests added * test added * rm 'only' from test suite * rm log * reorder test Co-authored-by: Peter Savchenko <specc.dev@gmail.com> Co-authored-by: Jorge <46056498+jorgectf@users.noreply.github.com>
34 lines
751 B
TypeScript
34 lines
751 B
TypeScript
import { SanitizerConfig } from "./sanitizer-config";
|
|
|
|
/**
|
|
* Tool onPaste configuration object
|
|
*/
|
|
export interface PasteConfig {
|
|
/**
|
|
* Array of tags Tool can substitute.
|
|
*
|
|
* Could also contain a sanitize-config if you need to save some tag's attribute.
|
|
* For example:
|
|
* [
|
|
* {
|
|
* img: { src: true },
|
|
* }
|
|
* ],
|
|
* @type string[]
|
|
*/
|
|
tags?: (string | SanitizerConfig)[];
|
|
|
|
/**
|
|
* Object of string patterns Tool can substitute.
|
|
* Key is your internal key and value is RegExp
|
|
*
|
|
* @type {{[key: string]: Regexp}}
|
|
*/
|
|
patterns?: {[key: string]: RegExp};
|
|
|
|
/**
|
|
* Object with arrays of extensions and MIME types Tool can substitute
|
|
*/
|
|
files?: {extensions?: string[], mimeTypes?: string[]};
|
|
}
|