WordPress.org

Support

Support » Plugins and Hacks » [Resolved] bug in wp-syntax/wp-syntax.php breaks highlight

[Resolved] bug in wp-syntax/wp-syntax.php breaks highlight

  • I am able to see the highlight feature work when I preview a post, however each time I switch between HTML and Visual editing, the highlight code is removed. After a little digging, I believe I found the source of the problem in wp-syntax/wp-syntax.php:

    function wp_syntax_change_mce_options($init) {
        $ext = 'pre[id|name|class|style|lang|line|escaped|hightlight|src]';
    
        if ( isset($init["extended_valid_elements"]) )
    	{
            $init["extended_valid_elements"] .= "," . $ext;
        } else {
            $init["extended_valid_elements"] = $ext;
        }
    
        return $init;
    }

    Specifically, highlight is mispelled “hightlight”. I verified that adding the same misspelling, hightlight, to the pre tag would persist between mode switches, however it would not actually trigger the highlight feature.

    Hope that this helps.

    Edit: typos and grammar.

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘[Resolved] bug in wp-syntax/wp-syntax.php breaks highlight’ is closed to new replies.