Search code examples
htmlangularxssevernote

Displaying Evernote Notes in Angular 2 - Sanitizing HTML stripped some content


Currently I have it set up so my Notes in evernote can be displayed on a website for content, but they don't show the way they should. I can't figure out how to get it to just display the way I try. Pictures don't show, links, videos, it all gets stripped out and says

WARNING: sanitizing HTML stripped some content (see http://g.co/ng/security#xss).

I understand to prevent xss attacks they've done this to me, but how to I stop it??

Currently I'm using this in the HTML template

<div [innerHTML]="note"></div>

where note is the string containing my ENML.

I'm just not sure where to start. I am hoping there's a quick easy way to just make it display the way it displays in Evernote itself.


Solution

  • Found the solution! I just did a pipe to mark the content as safe, like this guy did here:D