title: Angular 5 - sanitizing HTML with pipe
body: <p>When i got the warning:</p>
  <blockquote>
  <p>&quot;WARNING: sanitizing HTML stripped some content&quot;</p>
  </blockquote>
  <p>I did some research and saw people using the pipe below or a pipe that looks like the one below</p>
  <pre class="lang-js prettyprint-override"><code>import { Pipe, PipeTransform } from '@angular/core';
  import { DomSanitizer, SafeHtml } from '@angular/platform-browser';
  
  @Pipe({ name: 'sanitizeHtml' })
  export class SanitizeHtmlPipe implements PipeTransform {
  
      constructor(private _sanitizer: DomSanitizer) { }
  
      transform(v: string): SafeHtml {
          return this._sanitizer.bypassSecurityTrustHtml(v);
      }
  }
  </code></pre>
  <p>Unfortunately I still get the same error even when i implement the pipe like this:</p>
  <pre class="lang-html prettyprint-override"><code>&lt;span [innerHTML]=&quot;specialist.blocks[0].paragraph.html | sanitizeHtml&quot;&gt;&lt;/span&gt;
  &lt;p [innerHTML]=&quot;package.fields.remarks | sanitizeHtml&quot;&gt;&lt;/p&gt;
  &lt;li [innerHTML]=&quot;package.fields.name | sanitizeHtml&quot;&gt;&lt;/li&gt;
  </code></pre>
  <p>So I'm wondering if I implemented the pipe wrong or is there something else why it doesn't work?</p>
  <p><strong>Edit:</strong></p>
  <p>example of <code>specialist.blocks[0].paragraph.html</code>:</p>
  <blockquote>
  <p>&quot;&lt; div id=&quot;test&quot; class=&quot;test&quot;&gt; \n&lt; h3&gt;NAME SPECIALIST&lt;
  /h3&gt;\n&lt; p&gt;random text&lt; /p&gt;&lt; /div&gt;\n&lt; /div&gt;&quot;</p>
  </blockquote>
  <p>example of <code>package.fields.remarks</code>:</p>
  <blockquote>
  <p>&quot;Arrangement: 3 nachten incl. ontbijt en 2 greenfees p.p. met keuze
  uit North en South&lt; br&gt;\n- gratis dagelijkse toegang tot de spa (1 uur
  Hamman, sauna, zwembad, hydromassage)&quot;</p>
  </blockquote>
  <p>example of <code>package.fields.name</code>:</p>
  <blockquote>
  <p>&quot;Shortbreak 3 nachten&lt; br&gt;2 pers./Superior Double/LO, incl. golf&quot;</p>
  </blockquote>
  <p>Getting the warnings in firefox and chrome</p>