Quotation marks either work or are beautiful

It’s nice that sophisticated text editors apply correct quoting, using the “more beautiful” quotes instead of just the "standard" ones you get from the keyboard. Typological correctness is great. Until you paste code.

I recently wrote about getting jQuery IntelliSense working with MVC projects. Well, I went out and copy/pasted the code from the article, not realizing that WordPress had formatted the quotes for me. What’s wrong with the snippet below?

image

Yep, it’s the quotes, and the tooltip actually makes it very clear if you look carefully. I was wondering why jQuery wasn’t working at all, far less IntelliSense. But on a quick look, those lines seemed very much correct. After retyping the quotes in Visual Studio, everything is smooth again.

I have to admit it took me 15 minutes to discover this. Not because the problem was inherently so hard, but because the quotes looks correct enough and because I didn’t trust Visual Studio. Of course I saw those green squigglies the first time I pasted the code in, but given the history of Visual Studio’s web page editor working incoherently, I ignored them, looking at other things first. Naturally, I shouldn’t have.

Chalk it up as yet another classic example of a case where being able to trust your tools is important.

PS. I also installed the Unfancy Quote plugin for WordPress, removing the automation of tuning the quotes. Recommended!

September 13, 2009 · Jouni Heikniemi · One Comment
Tags: ,  · Posted in: .NET

One Response

  1. Aki Björklund - September 13, 2009

    I'm not sure about the standard quote handling in WordPress, but at least with more sophisticated tools the inch symbols would not be converted into quotes if you put them inside a proper code element.

    In your article your markup was not semantic enough that the automation could handle it for you.

Leave a Reply