Support » Plugin: WP-Syntax » [Plugin: WP-Syntax] Javascript not highlighted?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author shazahm1

    (@shazahm1hotmailcom)

    @steven Vachon

    It highlight JS fine for me.

    Plugin Author shazahm1

    (@shazahm1hotmailcom)

    Hmmm, this definitely works for me. You have the latest version of WP-Syntax installed?

    Can you paste a copy of the entire pre block in you post here between backtick?

    <p>For ActionScript:</p>
    <pre lang="actionscript" line="1">function shuffleArray(array:Array):Array
    {
    	var len:int = array.length;
    
    	for (var i:int=0; i<len; i++)
    	{
    		var j:int = Math.round( Math.random() * (len-1) );
    
    		var value:* = array[i];
    
    		array[i] = array[j];
    		array[j] = value;
    	}
    
    	return array;
    }</pre>
    
    <p>For JavaScript:</p>
    <pre lang="javascript" line="1">function shuffleArray(array)
    {
    	var len = array.length;
    
    	for (var i=0; i<len; i++)
    	{
    		var j = Math.round( Math.random() * (len-1) );
    
    		var value = array[i];
    
    		array[i] = array[j];
    		array[j] = value;
    	}
    
    	return array;
    }</pre>
    Plugin Author shazahm1

    (@shazahm1hotmailcom)

    Interesting. I can add exactly what you have and it works fine for me. For some reason GeSHi just seems to be not highlighting it for you.

    I’d forgotten that I’d added this to my code:

    add_action('wp_syntax_init_geshi', 'wp_syntax_config');
    
    function wp_syntax_config(&$geshi)
    {
    	$geshi->enable_classes();
    	$geshi->enable_keyword_links(true);
    	$geshi->enable_strict_mode(true);	// problematic
    }

    With strict mode disabled, it works fine. I’d enabled it at one point when I’d encountered an issue with <?php tags. Seems to be fine now, but it’s very possible that it could cause an issue in the future.

    But, still… why does JavaScript not work in strict mode? If you can, please fix this

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘[Plugin: WP-Syntax] Javascript not highlighted?’ is closed to new replies.