encoding - TinyMCE HTML Encode Backslash

admin2025-01-07  3

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......

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......

Share Improve this question asked Oct 22, 2014 at 15:46 workabyteworkabyte 1011 bronze badge
Add a comment  | 

1 Answer 1

Reset to default 0

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, "\");
                    });
                }',
转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1736258069a486.html

最新回复(0)