Skip to content

Is sanitize expected to ignore camel-cased attributes even when set in the schema? #183

Answered by ChristianMurphy
xiaohk asked this question in Q&A
Discussion options

You must be logged in to vote

Hey @xiaohk!

Hello, I'm wondering if it's expected for camel-cased attributes to be removed even when I include them in the schema?

HTML is case insensitive (lowercase), and the schema does not rename attributes

The custom schema you are probably looking for is

  const customSchema = {
    ...defaultSchema,
    attributes: {
      ...defaultSchema.attributes,
      '*': ['class', 'my-name', 'coolname'],
    },
  };

That said with all the camel case, I get the sense you may actually may want XML or JSX? Are you interacting with a domain specific language or templating language?

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@xiaohk
Comment options

@ChristianMurphy
Comment options

Answer selected by xiaohk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants