I am using TinyMCE to style content that the user then saves to the database, an example of what the user could be saving is as below:
<ol><li><em>This</em> is a <span style="text-decoration: underline;" data-mce-style="text-decoration: underline;">HTML</span> email that <strong><span style="font-family: 'times new roman', times;">should</span></strong> <span style="font-family: tahoma, arial, helvetica, sans-serif;">contain</span> different <span style="font-family: arial, helvetica, sans-serif;">fonts</span> in weights with lists and links...</li></ol>
I am currently using ng-bind-html
to display this HTML content in my view, however, it appears to be stripping the inline styles. Here is my source from the browser:
<ol><li><em>This</em> is a <span>HTML</span> email that <strong><span>should</span></strong> <span>contain</span> different <span>fonts</span> in weights with lists and links...</li></ol>
Is there a way in which I can keep these inline styles in the view?
you could try marking your HTML as trusted, passing in $sce, as: