1
votes

TinyMCE is encoding HTML tags, so if I have something like:

<b>Test</b>

When saved to the DB will be saved as:

&lt;b&gt;test&lt;/b&gt;

My init is:

tinymce.init({
        selector: '#post-message',
        mode: "specific_textareas",
        height: 500,
        menubar: false,
        plugins: 'paste print preview searchreplace autolink directionality visualblocks visualchars fullscreen image link media template codesample table charmap hr pagebreak nonbreaking anchor toc insertdatetime advlist lists textcolor wordcount imagetools contextmenu colorpicker textpattern help',
        theme_advanced_buttons3_add : "pastetext,pasteword,selectall",
        toolbar: 'bold italic link | numlist bullist',
        paste_word_valid_elements: "b,i,p,a[href],ol,ul,li,em,br",
        entity_encoding: "raw",
        paste_preprocess: function(p1, precontent){
            var clean_content = clear_content(precontent.content);
            precontent.content = html_decode(clean_content)
        },
        branding: false
    });

Notice that entity_encoding is set to raw. Is there a way to disable this? I want the data to be saved as entered.

Thanks

1

1 Answers

1
votes

I don't think that TinyMCE is doing that on its own...it won't modify the HTML as you show. Can you make a TinyMCE Fiddle that shows a call to getContent() causing TinyMCE to return the content as you suggest? Are you using a server side framework? Is it possible that some other part of your app is doing this modification?