Skip to content

[bug] mismatch sanitizer option #179

@TechQuery

Description

@TechQuery

Describe the bug

@shgysk8zer0 Example Code in ReadMe document is mismatch with latest specification of sanitizer option, which is a named field in an object instead of an independent argument:

import { elements, attributes } from '@aegisjsproject/sanitizer/config/html.js';

const sanitizer = {
  elements: ['hello-world', ...elements],
  attributes: ['foo', ...attributes],
};

document.querySelector('.container').setHTML(`
  <hello-world foo="bar"></hello-world>
`, sanitizer);

Expected behavior

https://wicg.github.io/sanitizer-api/#configobject

import { elements, attributes } from '@aegisjsproject/sanitizer/config/html.js';

const sanitizer = {
  elements: ['hello-world', ...elements],
  attributes: ['foo', ...attributes],
};

document.querySelector('.container').setHTML(`
  <hello-world foo="bar"></hello-world>
`, { sanitizer });
// 👆 changed here

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions