Codemirror is stripping html and style tags

54 views Asked by At

I am Using Code Mirror in my project, When I am posting Html content in code mirror, and previewing the same content, html and style tags are being removed. so styles are not being applied in the preview section. Is there any way to include those tags, so as to work as expected. I am adding images for reference,

editor and preview

the styles red and blue are not being applied in the preview section.

I am adding code for refrence.

code

Code for Refeence

    <ngx-codemirror
[options]="{
lineNumbers: true,
theme: 'material',
mode: 'xml',
tabSize: 2,
pasteLinesPerSelection: true
}"
[(ngModel)]="code"
></ngx-codemirror>
<div 
   [innerHTML]="code"></div>
0

There are 0 answers