I have an ASP.NET MVC web app that uses tinyMCE Rict Text Editor 4.5.4 NuGet package.
Since it is vulnerable, need to update to latest version 7.2.1 or find an alternative.
Please find the init part and it is not working if I update or use cdn reference.
Please advise which causes the issue. The control itself does not appear.
tinymce.init({ selector: 'textarea.dataEditor', content_style: ".mce-content-body {font-size:9pt;font-family:Segoe UI;}", height: 300, theme: 'modern', menubar: 'edit', force_br_newlines: false, force_p_newlines: false, forced_root_block: '', invalid_styles: {'*': 'margin' }, plugins: ['advlist autolink lists link image charmap print preview hr anchor pagebreak','searchreplace wordcount visualblocks visualchars code fullscreen','insertdatetime media nonbreaking save table contextmenu directionality','emoticons template paste textcolor colorpicker textpattern imagetools codesample toc' ], fullpage_default_font_family: "Segoe UI;", fullpage_default_font_size: "9pt", contextmenu: "paste", paste_create_paragraphs: false, paste_create_linebreaks: false, paste_auto_cleanup_on_paste: true, paste_convert_middot_lists: false, paste_unindented_list_class: "unIndentedList", paste_convert_headers_to_strong: true, paste_retain_style_properties: "margin, padding, width, height, font-weight, color, text-align, text-decoration, border, background, float, display", paste_remove_styles_if_webkit: false, paste_preprocess: function (pl, o) { o.content = o.content.replace(/”/g, "\""); o.content = o.content.replace(/“/g, "\""); o.content = o.content.replace(/’/g, "\'"); }, toolbar: 'undo redo | fontselect fontsizeselect | numlist bullist checklist | outdent indent | preview', font_formats: 'Segoe UI=segoe ui',//;Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats', fontsize_formats: "9pt",//"8pt 9pt 10pt 10.5pt 11pt 12pt 14pt 18pt 24pt 36pt", image_advtab: true, init_instance_callback: function myCustomInitInstance(inst) { var editor = $(inst.getContainer())[0]; var readonly = $(editor).parents(".Details").find("input[name*='IsCompleted']").val() == "True"; if (readonly) { inst.setMode('readonly'); } }, setup: function (ed) { ed.on('init', function (ed) { this.getDoc().body.style.fontSize = "9pt"; ed.target.editorCommands.execCommand("fontName", false, "Segoe UI"); //ed.target.editorCommands.execCommand("fontSize", false, "17.5"); }); } });
I create a new ASP.NET MVC project and added the following. It displays the rich text editor, but it is not editable:
document.addEventListener('DOMContentLoaded', function () { tinymce.init({ selector: '#myEditor', height: 300, menubar: false, plugins: ['advlist autolink lists link image charmap preview anchor','searchreplace visualblocks code fullscreen','insertdatetime media table paste code help wordcount' ], toolbar: 'undo redo | formatselect | bold italic backcolor | \ alignleft aligncenter alignright alignjustify | \ bullist numlist outdent indent | removeformat | help', content_css: '//www.tiny.cloud/css/codepen.min.css' });
Please advise which properties is not compatible to latest version and what is best way to migrate to latest or advise on alternate.
If I create a new ASP.NET MVC and add TinyMCE then rich-text editor works, but if I update the existing NuGet from 4.5.4 to 7.2.1, then it is not working.
Please advise if I have to anything since there is major change.