We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c860be9 commit 2fb062bCopy full SHA for 2fb062b
src/app/frontend/common/pipes/safehtml.ts
@@ -12,7 +12,7 @@
12
// See the License for the specific language governing permissions and
13
// limitations under the License.
14
15
-import {Pipe} from '@angular/core';
+import {Pipe, SecurityContext} from '@angular/core';
16
import {DomSanitizer, SafeHtml} from '@angular/platform-browser';
17
18
/**
@@ -23,6 +23,9 @@ export class SafeHtmlFormatter {
23
constructor(private readonly sanitizer: DomSanitizer) {}
24
25
transform(value: string): SafeHtml {
26
- return this.sanitizer.bypassSecurityTrustHtml(value.replace(' ', ' '));
+ return this.sanitizer.sanitize(
27
+ SecurityContext.HTML,
28
+ value.replace('<', '<').replace('>', '>'),
29
+ );
30
}
31
0 commit comments