nocode style is not being recognized
-
Nice job on this plugin. I’m happy to be using it.
The Prettify documentation indicates that you should be able to have some HTML interpreted as HTML if you include the ‘nocode’ class. For example, if you have
<span class="redbold">server_name</span>
inside your pre tags, you will see the HTML just as it is written , but if you use
<span class="nocode redbold">server_name</span>
you should see just ‘server_name’ formatted according to the redbold class.
That is not working with your plugin, and I tracked it down to the WPCP_ParseCode() method. You are converting some special characters into entities starting on line 57:
$html_entities_match = array( "|\<br \/\>|", "#\<#", "#\>#", "|/|", '#\[#', '#\]#', '#"#', "#'#" ); $html_entities_replace = array( "\n", '<', '>', '/', '[', ']', """, '''); $plaincode = preg_replace( $html_entities_match, $html_entities_replace, $plaincode );
If I comment out those lines, nocode works as expected. I assume you had a good reason to put these lines of code in, however, so I don’t think I can recommend that you remove them for everyone. I’m not seeing any adverse affects, but I’m using the ‘pre’ tag exclusively, and I suspect the ‘code’ tag might need the extra processing.
If you can tell me what the lines are intended to fix, maybe I can come up with a way to do it that doesn’t break nocode.
- The topic ‘nocode style is not being recognized’ is closed to new replies.