mirror of
https://github.com/codex-team/editor.js
synced 2024-05-19 14:56:46 +02:00
Fix SanitizerConfig type definition (#1456)
* Fix SanitizerConfig type definition * Update docs/CHANGELOG.md Co-authored-by: Peter Savchenko <specc.dev@gmail.com> * Fix CHANGELOG * Add JSDoc to TagConfig * yarn lint:fix Co-authored-by: Peter Savchenko <specc.dev@gmail.com> Co-authored-by: George Berezhnoy <gohabereg@users.noreply.github.com>
This commit is contained in:
parent
2759b25d35
commit
a67e699991
|
@ -13,6 +13,7 @@
|
|||
- `Fix` - Fix an unstable block cut process [#1489](https://github.com/codex-team/editor.js/issues/1489).
|
||||
- `Fix` - Type definition of the Sanitizer config: the sanitize function now contains param definition [#1491](https://github.com/codex-team/editor.js/pull/1491).
|
||||
- `Fix` - Fix unexpected behavior on an empty link pasting [#1348](https://github.com/codex-team/editor.js/issues/1348).
|
||||
- `Fix` - Fix SanitizerConfig type definition [#1513](https://github.com/codex-team/editor.js/issues/1513)
|
||||
- `Refactoring` - The Listeners module now is a util.
|
||||
- `Fix` - Editor Config now immutable [#1552](https://github.com/codex-team/editor.js/issues/1552).
|
||||
|
||||
|
|
8
src/types-internal/html-janitor.d.ts
vendored
8
src/types-internal/html-janitor.d.ts
vendored
|
@ -3,9 +3,15 @@
|
|||
* After that we can use it at the TS modules
|
||||
*/
|
||||
declare module 'html-janitor' {
|
||||
/**
|
||||
* Sanitizer config of each HTML element
|
||||
* @see {@link https://github.com/guardian/html-janitor#options}
|
||||
*/
|
||||
type TagConfig = boolean | { [attr: string]: boolean | string };
|
||||
|
||||
interface Config {
|
||||
tags: {
|
||||
[key: string]: boolean|{[attr: string]: boolean|string}|(() => any)
|
||||
[key: string]: TagConfig | ((el: Element) => TagConfig)
|
||||
};
|
||||
}
|
||||
|
||||
|
|
8
types/configs/sanitizer-config.d.ts
vendored
8
types/configs/sanitizer-config.d.ts
vendored
|
@ -1,3 +1,9 @@
|
|||
/**
|
||||
* Sanitizer config of each HTML element
|
||||
* @see {@link https://github.com/guardian/html-janitor#options}
|
||||
*/
|
||||
type TagConfig = boolean | { [attr: string]: boolean | string };
|
||||
|
||||
export interface SanitizerConfig {
|
||||
/**
|
||||
* Tag name and params not to be stripped off
|
||||
|
@ -31,5 +37,5 @@ export interface SanitizerConfig {
|
|||
* }
|
||||
* }
|
||||
*/
|
||||
[key: string]: boolean|{[attr: string]: boolean|string}|((el?: Element) => any);
|
||||
[key: string]: TagConfig | ((el: Element) => TagConfig);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue