Skip to content

sanitize method for Block Tool seems to be typed wrong #2957

@adaptedbee

Description

@adaptedbee

Case 1:

In Block Tool types, sanitize should return SanitizerConfig (which is object with tag names as keys). Examples in SanitizerConfig are also written for fields with tag names as keys.

Case 2:

In documentation, it returns object with 'url' and 'caption' keys.
Same behavior in other official plugins, such as paragraph, quote etc.
And unfortunately, in that situation I can't use function as value for tag name, because tag name here becomes typed as 'attr'.

Editor.js version: 2.30.8

I can't understand which of that cases is right or wrong.
Is there any correct way to use function for sanitizing tag?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions