ASP.NET MVC on .NET 4.7.1 app uses TinyMCE RichTextEditor NuGet Package on Update from 4.5.4 to 7.2.1 is not working

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.

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code> 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");
});
}
});
</code>
<code> 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"); }); } }); </code>
    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:

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
<code>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'
});
</code>
<code>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' }); </code>
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.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật