SyntaxHighlighter problems with jQuery 1.7.1

Recently I upgraded my WordPress plugins to jQuery version 1.7.1 and noticed that Internet Explorer 8 was causing errors “‘null’ is null or not an object”. I isolated this to the SyntaxHighlighter Evolved WordPress plugin I was also uses.

On further Googling it seemed that there were issues with the XRegExp library and jQuery 1.7.1, reported by other uses on IE 6 to 9. Schabse Laks posted a fix to the problem on his blog, though this gave me a new error, so I have modified it slightly, modification on line 271;

RegExp.prototype.exec = function (str) {
	if (typeof(str) !== "string")
		str = String(str);
	var match = real.exec.apply(this, arguments),
		name, r2;

Download the resolved SyntaxHighlighter files here
shCore.max.js
shCore.js

11 thoughts on “SyntaxHighlighter problems with jQuery 1.7.1

  1. You sir are a genius. Keep up the good work. I was totally stumped until I read this post. Can’t understand why the latest version of SH is not working.

  2. Pingback: Design2U » [jquery] 解決 1.7.1 版本與SyntaxHighlighter 衝突問題

  3. Pingback: jQuery 1.7.1 和 syntaxHighlighter 3.0.8 在ie8以下报错 | 云淡然

  4. Pingback: Jquery1.7.1与SyntaxHighlighter在IE8下脚本错误修正 | 梧桐树下

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>