TinyMCE HTML Encode Backslash

so my question is similar to the one found here, following the example there i am trying to force Tiny MCE to encode backslashes......

currently all i am doing to test this is setting a break point on the page for the following line

tinymce.init( init );

then i run the following in the console

init.entities += ",92,#92"; init.entity_encoding = "named";

I see the values update in the init object but my \ is not converted....

not really sure what i am missing......

Topic tinymce Wordpress encoding

Category Web


ok so finally found a solution to this. i had to edit class-wp-editor.php and include the following for the $first_init array

                'setup' => 'function(ed) 
                {                        
                    ed.onGetContent.add(function(ed, o) {
                        // Replaces all a characters with b characters
                        o.content = o.content.replace(/\\\\/g, "\");
                    });
                }',

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.