This is post #29 in the Building Neno series. Please click here for a description of the Building Neno project and instructions on how to access the source code for this post.
I don't use Internet Explorer at home or work if I can help it. Even intranet developers on the Microsoft stack have to struggle with CSS occasionally, so the small amount of goodwill I had towards this stalwart of earlier years disappeared long ago.
That said, IE is still the standard browser at work. That means I have to fire it up every now and then to make sure my applications render nicely. Doing that today I realised I hadn't checked http://stackingcode.com/ with IE at all yet. So I brought it up, and much to my surprise, it rendered great, thanks to Blueprint.
Scrolling down however, I found the Prettify syntax highlighting did not render correctly...
The line breaks are failing in IE8 and IE7. My default browser, Firefox, works just fine of course, and so does iPad Safari. I don't use IE, nor do I think anyone else should either, but it is a common browser and as such can't be completely ignored (yet). So back at home I dedicated some time to fixing it.
The short of it is, my implementation of Prettify marks my <pre><code>
blocks like this...
$('pre code').addClass('prettyprint');
After googling, stepping through JavaScript, and finally looking at some sites that use Prettify without any problem in IE, I realised the class attribute was going on the wrong tag. I was putting it on the code
tag while other sites were putting it on the pre
tag. The fix is as simple as...
$('pre code').parent().addClass('prettyprint');
Firefox and Safari don't care of course, but IE does and now it all works as expected. I'd groan, but having to tinker with IE to get something to work has been such a massive timesink over the years, another couple of hours is nothing by comparison.
There are 0 comments.
Newer
got pivot?
Newer
got pivot?
browse with Pivot
Codility Nitrogenium Challenge
OS X Lock
HACT '13
Codility Challenges
Priority Queue
Architecture (13)
ASP.NET (2)
ASP.NET MVC (13)
Brisbane Flood (1)
Building Neno (38)
C# (4)
Challenges (3)
Collections (1)
Communicator (1)
Concurrency Control (2)
Configuration (1)
CSS (5)
DataAnnotations (2)
Database (1)
DotNetOpenAuth (2)
Entity Framework (1)
FluentNHibernate (2)
Inversion of Control (5)
JavaScript (1)
jQuery (4)
Kata (2)
Linq (7)
Markdown (4)
Mercurial (5)
NHibernate (20)
Ninject (2)
OpenID (3)
OS X (1)
Pivot (6)
PowerShell (8)
Prettify (2)
RSS (1)
Spring (3)
SQL Server (5)
T-SQL (2)
Validation (2)
Vim (1)
Visual Studio (2)
Windows Forms (3)
Windows Service (1)
Comments
Leave a Comment
Please register or login to leave a comment.