editor.js/types/configs/paste-config.d.ts
Umang G. Patel f659015be6
fix(tools-api): pasteConfig.tags now supports a sanitize config (#2100)
* 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>
2022-11-22 00:28:53 +04:00

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[]};
}