tinyMCE5 is adding p tags automatically only on firefox

180 views Asked by At

I have an editor with tinymce5 working good on chrome and other browsers, but with mozilla firefox each line on my editor gets an aditional p tag. im using it with angular.

Currently i have the editor init like this

    <editor name="resultEditor" 
            contenteditable="false" overflow="true" id="resultEditor" [(ngModel)]="resultEditor"
            [disabled]="true"
            [init]="{base_url: '/tinymce',
            suffix: '.min',
            height: 450,
            menubar: false,
            branding: false,
            toolbar: false,
            statusbar: false,
            content_style: '.mce-content-body { font-family: monospace;} p {margin: 0}'}">
   </editor>

for the editor im using '@tinymce/tinymce-angular'

I have seen in previous versions that for this case we had the property "force_p_newlines: false", but i try it on this version and it didnt work.

1

There are 1 answers

0
chris burd On

you can do this by importing tinymce into your component. import * as tinyMCE from 'tinymce'

ngOnInit(){
tinyMCE.init({
  mode : "textareas",
  theme : "advanced",
  force_br_newlines : false,
  force_p_newlines : false,
  forced_root_block : false,
});
}

this should fix your problem.