Home Tinymce is not returning HTML but just text
Reply: 0

Tinymce is not returning HTML but just text

user3511
1#
user3511 Published in June 22, 2018, 11:31 am

I'm struggeling with this problem. I'm very new to javascript i had tinymce v3 for my website working, but i wanted to update it also looked way to complicated. So i installed v4 it took me a while but i finaly got i working. In the sence of its showing the textarea. When i post my page it does not return text with html tags around it but just a string. And when i use blockquotes it just returns a string with [quote][/quote]. This is the code i use.

<script src="@Url.Content("~/Scripts/tinymce/jquery.tinymce.min.js")" type="text/javascript"></script>

<script type="text/javascript">

    (function(){ 

      $(function() { 

          $('#@ViewData.TemplateInfo.GetFullHtmlFieldName(string.Empty)').tinymce({

            // Location of TinyMCE script
            script_url: '@Url.Content("~/Scripts/tinymce/tinymce.js")',
            theme: "modern",

            height: "300",
            width: "1150",
            verify_html: true,
            statusbar: true,
            plugins : "pagebreak,bbcode,link,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,wordcount,advlist,autosave",

            // Theme options
            theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect",
            theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
            theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
            theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,thisisnotvaled,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak,restoredraft,codehighlighting,netadvimage",
            theme_advanced_toolbar_location : "top",
            theme_advanced_toolbar_align : "left",
            theme_advanced_statusbar_location : "bottom",
            theme_advanced_resizing : false,

            // Example content CSS (should be your site CSS)
            content_css : "@Url.Content("~/Scripts/tinymce/css/content.css")",
            convert_urls: false,

            // TODO: Make line breaks work and qoutes are now also not working

            force_br_newlines: true,
            force_p_newlines: true,
            forced_root_block: '',
            remove_linebreaks: false,
            convert_newlines_to_br: true,

            // Drop lists for link/image/media/template dialogs
            template_external_list_url : "lists/template_list.js",
            external_link_list_url : "lists/link_list.js",
            external_image_list_url : "lists/image_list.js",
            media_external_list_url : "lists/media_list.js"

        });

      });

    })();

</script>

Its also not forcing line breaks i think mainly because its also not returning HTML. i have been searching but i cant find anything concrete. So just to simplyfy it its returning it like this : Hello world. But i want it like this : <p>hello world</p>


You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.307983 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO