In other words, programmers ' blogs always use syntaxhighlighter to put a bunch of code in the pre tag. So because of installed CKEditor for WordPress has been very annoying, in the HTML tag to write some code, to the visual is escaped. For example, > and < become the >< shrimp. Words today to Google a whim, CKEditor's setup document is really relevant settings, please watch here!
Configure the Ckeditor.config.js file under the CKEditor plug-in directory, and join the following line.
Copy Code code as follows:
Config.entities = false;
But this is more violent, all the content is not escaped, there is no one to worry about. So here's another way to do it. (below), using regular filters to protect the code. This is very good for the data, but there is a drawback, in the ckeditor see that the resulting model can not see the protected content, this depends on your own choice.
Copy Code code as follows:
Config.protectedSource.push (/<pre[\s\s]*?pre>/g);
It seems that I still tend to use the former ~ in the WYSIWYG label will be the sticky content of the contents are still escaped, but the content of the HTML is not escaped, looks good. Independent blog is really going to toss ah = = Strange hard ...