• Is there a way to disable the filter that converts < and > to their HTML counterparts (as well as entirely removing lines that WP thinks are bad markup)?

    I’m using the WP-Syntax plugin, which works great – except that if I switch to TinyMCE in the middle of writing a post, it strips out all my code (I frequently write about ColdFusion, so WP removes all my CF code, because it’s enclosed in < and > brackets).

    I know that I don’t need to use the visual editor, but it’s simply easier to quickly format things (Ctrl+B and Ctrl+I format in bold and italics, for instance), so I’d still like to be able to use both.

    So is there a way to disable whatever filter is modifying my code in the TinyMCE view?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter shifuimam

    (@shifuimam)

    For anyone else with this problem, I found a solution.

    It requires modifying any of the GeSHi syntax files you use, as well as geshi.php.

    In geshi.php, find the line that contains function hsc(...) {. Comment out the following lines:

    '&' => '&amp;',
    ';' => '<SEMI>',

    Then, you need to go into each syntax/language PHP file, and in the SYMBOLS array change & to &amp;, < to & gt; (no space, though), and > to & lt;. Then go down to the end and, if your chosen language uses < and > brackets to delimit code, change those to their HTML counterparts anywhere in the SCRIPT_DELIMITERS array.

    Now, when you paste your markup into the WYSIWYG editor, TinyMCE will appropriately convert your < and > to HTML code, and your markup won’t be messed up when switching between WYSIWYG and HTML source views.

    Thread Starter shifuimam

    (@shifuimam)

    [retracted]

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Disable code/markup filtering in WYSIWYG editor’ is closed to new replies.