mirror of
https://github.com/codex-team/editor.js
synced 2026-03-16 15:45:47 +01:00
The sanitize property on BlockTool and BaseToolConstructable was typed
as SanitizerConfig, which only allows tag-name keys with SanitizerRule
values. In practice, Block Tools return an object mapping data field
names to their own SanitizerConfig (as documented and used by official
plugins like Paragraph and Quote).
This caused TypeScript errors when using functions as sanitizer rules
within per-field configs, since the type system tried to match the
function against TagConfig's { [attr: string]: boolean | string }.
Widen the type to SanitizerConfig | Record<string, SanitizerConfig>
to match the runtime behavior already handled by cleanObject() in
src/components/utils/sanitizer.ts.
Fixes #2957
|
||
|---|---|---|
| .. | ||
| api | ||
| block-tunes | ||
| configs | ||
| data-formats | ||
| events/block | ||
| tools | ||
| utils/popover | ||
| index.d.ts | ||