Title: [Plugin: WP-Syntax] Javascript not highlighted?
Last modified: August 20, 2016

---

# [Plugin: WP-Syntax] Javascript not highlighted?

 *  Resolved [Steven Vachon](https://wordpress.org/support/users/prometh/)
 * (@prometh)
 * [13 years, 8 months ago](https://wordpress.org/support/topic/plugin-wp-syntax-javascript-not-highlighted/)
 * `lang="javascript" line="1"` adds the line numbers and the other wrapper code,
   but it does not highlight. Perhaps a bug in GeSHi?
 * [http://wordpress.org/extend/plugins/wp-syntax/](http://wordpress.org/extend/plugins/wp-syntax/)

Viewing 6 replies - 1 through 6 (of 6 total)

 *  Plugin Author [Steven](https://wordpress.org/support/users/shazahm1hotmailcom/)
 * (@shazahm1hotmailcom)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/plugin-wp-syntax-javascript-not-highlighted/#post-3014855)
 * **[@steven](https://wordpress.org/support/users/steven/) Vachon**
 * It highlight JS fine for me.
 *  Thread Starter [Steven Vachon](https://wordpress.org/support/users/prometh/)
 * (@prometh)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/plugin-wp-syntax-javascript-not-highlighted/#post-3014856)
 * [http://www.svachon.com/blog/shuffle-and-randomize-arrays-in-actionscript-and-javascript/](http://www.svachon.com/blog/shuffle-and-randomize-arrays-in-actionscript-and-javascript/)
 *  Plugin Author [Steven](https://wordpress.org/support/users/shazahm1hotmailcom/)
 * (@shazahm1hotmailcom)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/plugin-wp-syntax-javascript-not-highlighted/#post-3014857)
 * 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?
 *  Thread Starter [Steven Vachon](https://wordpress.org/support/users/prometh/)
 * (@prometh)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/plugin-wp-syntax-javascript-not-highlighted/#post-3014858)
 *     ```
       <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 [Steven](https://wordpress.org/support/users/shazahm1hotmailcom/)
 * (@shazahm1hotmailcom)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/plugin-wp-syntax-javascript-not-highlighted/#post-3014859)
 * 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.
 *  Thread Starter [Steven Vachon](https://wordpress.org/support/users/prometh/)
 * (@prometh)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/plugin-wp-syntax-javascript-not-highlighted/#post-3014886)
 * 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.

 * ![](https://s.w.org/plugins/geopattern-icon/wp-syntax_f8f6f6.svg)
 * [WP-Syntax](https://wordpress.org/plugins/wp-syntax/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-syntax/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-syntax/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-syntax/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-syntax/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-syntax/reviews/)

 * 6 replies
 * 2 participants
 * Last reply from: [Steven Vachon](https://wordpress.org/support/users/prometh/)
 * Last activity: [13 years, 2 months ago](https://wordpress.org/support/topic/plugin-wp-syntax-javascript-not-highlighted/#post-3014886)
 * Status: resolved