Skip to content

Commit

Permalink
inject DOMService to sanitizeAttr
Browse files Browse the repository at this point in the history
  • Loading branch information
root authored and root committed Mar 15, 2024
1 parent 616df6d commit a5f3f81
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/components/_attrs/sanitize-html.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { Observable, AttributeConfiguration } from '@microsoft/fast-element';
import RWSViewComponent from '../_component';
import { DOMService } from '../../services/DOMService';
import DOMService from '../../services/DOMService';
import RWSContainer from '../_container';
import { IOptions } from 'sanitize-html';

import * as he from 'he';
Expand Down Expand Up @@ -68,7 +69,7 @@ function modifyPropertyDescriptor(target: any, propertyKey: string, config: IOpt
set(value: any) {
if (typeof value === 'string') {
console.log('sanitizing', value);
this[privatePropName] = DOMService.sanitizeHTML(value, null, config);
this[privatePropName] = RWSContainer().get(DOMService).sanitizeHTML(value, null, config);
console.log('sanitized', this[privatePropName], config);

} else {
Expand Down

0 comments on commit a5f3f81

Please sign in to comment.