Translate

Chrome and SyntaxHighlighter Bug

Chrome and SyntaxHighlighter Bug
SyntaxHighlighter is one of the best syntax highlighting JS libraries at the moment and works great with all major browsers. But the recent development of Chrome has some conflict with above and specially when you are hosting on blogger.

Chrome/SyntaxHightlighter

I have been looking for a fix for a while and spent many hours browsing web for a solution as well as try to develop and fix myself. Width of the container which the SyntaxHighlighter added has a direct effect on this bug on Chrome. In any other browser it works fine even the MSIE.

How to fix

var isChrome = navigator.
 userAgent.
 toLowerCase().
 indexOf('chrome') > -1;
if(isChrome){ 
 SyntaxHighlighter.defaults['gutter'] = false; 
}
This is the only option I found so far and not the best I have to say, if you found something better, please feel free to post on comment.

No comments:

Post a Comment

Nerdcore is a free tutorial website about latest technological development, designing and programming. Nerdcore have tuts for all skill levels in web, desktop and mobile application development. Tuts and courses we provided are carefully crafted by expert developers and designers from www.waan.it