Skip to content

Commit ea7c6c7

Browse files
committed
Fix incorrect condition
That caused non-imported elements to be sanitized when sanitization was set to `'imports'`.
1 parent 757d0e8 commit ea7c6c7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Descriptor.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,8 @@ export class Descriptor {
106106
// Set the attributes.
107107
if (rule.attributes) {
108108
for (const attribute of rule.attributes) {
109-
if (this.sanitize !== 'off' && immediatelySanitizedAttributes.includes(attribute.name)) continue;
109+
if ((this.sanitize === 'all' || (this.sanitize === 'imports' && this.isImported))
110+
&& immediatelySanitizedAttributes.includes(attribute.name)) continue;
110111
let value = '';
111112
if (attribute.value?.type === 'String') {
112113
value = attribute.value.value;

0 commit comments

Comments
 (0)