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

  • http://www.zacwitte.com Zac Witte

    thanks!

  • Henry

    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.

  • http://design2u.me/blog/ JackyPeng

    it solved my problem, Thanks a lot ! 

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

  • yundanran

    Thanks ,it solved my problem,too

  • Cloudcome

    tks

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

  • http://twitter.com/davidpmccormick ʞɔıɯɹoɔɔɯ pıʌɐp

    Thanks.

  • Nicolas Mollet

    Thanks, saved me lots of time!

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

  • raks

    God bless you. Saved me lots of time.