
We employ the use of sIFR on a regular basis. Its great at showing cool fonts without resorting to a massive effort of managing image text files, plus they're search engine friendly.
We encountered a problem the other day where sIFR was displaying a space character to the left of the text. It wasn't horrible, but still undesireable. Upon examination of the xHTML source, the markup looked like this:
<h1>
Upcoming Events</h1>
That was the default formatting behavior of VS.Net 2005. My normal M.O. is to type or paste in the xHTML content, press CTRL+E+D (the chord that equates to the menu bar command of Edit, Advanced, Format Document). This command formats both xHTML content and C# code, whatever you're doing in VS.Net; a nice time saver.
In the back of my mind, I recall seeing something on Google Groups or a web site where someone asked if the formatting template was editable, and I thought the response was negative. It would be nice to edit that template, but it is what it is, and perhaps in a future version. Well, the template that VS.Net applies isn't exactly how I would format the code if I was doing it manually, but it was pretty close, so that didn't bother me much at all.
Enter: The problem with sIFR displaying the first space before the "U" in Upcoming Events.
There was no reason sIFR should be displaying this space. The only way we saw to fix it was delete the opening spaces so the xHTML looked like this:
<h1>Upcoming Events</h1>
Easy enough to do for one instance, but we're talking about a lot of pages here.
Justin Garrity from the Design Team asked the obvious question, "Can you modify the formating template?" I answered, "Nope, it is what it is. Where are the interns?"
Justin wasn't satisfied with that answer and proceeded to tackle the problem with a tanacity that suggested he was actually an undercover expert in Visual Studio.Net 2005 and perhaps also certified in deep sea welding.
The converstation went somewhat like this:
Justin said "Hey, uh, can you bring up that options window?" I said "Sure" and clicked Tools, Options. Then he said, "Uh.. yeah, can you click expand Text Editor, HTML and click the Format item?" I was getting nervous. I hadn't delved into this section of VS.Net too far, and it seemed oddly appropriate for exactly what we were looking for. My suspicions about Justin where beginning to rise.
"Hey Andrew, can you click the Tag Specific Options button? Yeah, now expand the Client HTML Tags item. Now click the New Tag button and create a rule for the H1 tag. Its not in the rule set by default. Edit the Per Tag Formatting options section and set the Line Breaks item to the value of Before and After..."
And there we go. The auto format command of ctrl+E+D works like a champ. Rather than solve the sIFR problem, we changed the rules and away we go.
Now, what else is Justin going to show us about VS.Net 2005?