Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] sanitizerConfig works incorrectly #2029

Open
gohabereg opened this issue Apr 26, 2022 · 0 comments
Open

[Bug] sanitizerConfig works incorrectly #2029

gohabereg opened this issue Apr 26, 2022 · 0 comments
Labels

Comments

@gohabereg
Copy link
Member

Description

BlockTool.sanitize property returns an object with the same shape as Tool's data object. sanitize object container SanitizerConfig as leafs.

Examples:

{
  text: {
   br: true,
  },
}
{
  caption: {
    text: { br: true }
  }
}

Internal BlockTool class has baseSanitizeConfig and sanitizeConfig preoptries.

baseSanitizerConfig is merge of sanitize configs of inline tools and tunes used by Block tool

sanitizeConfig returns an object with the shape of original tool.sanitize, but each with merged baseSanitizerConfig to each property.

Example
Tool config: { text: { br: true } }
Inline Tool config: { b: true }
Tune config: { sup: true }

baseSanitizeConfig would be { b: true, sup: true }
sanitizeConfig would be { text: { br: true, b: true, sup: true } }

Problems

  1. baseSanitizeConfig should be renamed so its name reflects it is a merge of Tunes and Inline Tools sanitize configs
  2. Return type of sanitizeConfig should be changed to reflect shape of the data object
  3. sanitizeConfig should be able to process nested fields of data object (also need to check the same in Saver module)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant