Upgrading to XHTML 1.1
I stumbled across this discussion of 'anorexic anchors' the other day and was bummed to find that my index template used the same technique. I thought of the perils of switching to XHTML 1.1 and decided that it would be too much to change.
I got to thinking about it again today, and realized that I don't use numbers for permalink anchors: I use the post title. Realizing this, I set about implementing anchors the way Tantek recommends. It worked, and now the id attribute is embedded in the div block containing each blog entry.
So now I have completely banished the name attribute from this site. To switch from XHTML 1.0 Strict to XHTML 1.1 should be a simple task of selecting the appropriate DOCTYPE, changing my language identification slightly, and doing a complete rebuild, right?
Wrong.
I was reminded by Mark Pilgrim's first XHTML 1.1 experience that the id attribute cannot begin with a number. I figured that this wouldn't be a major problem: I opened Movable Type's search tool, directed it to search only in title, turned on the Regular Expression option, and (because I didn't spend the three seconds to remember that '^' indicates searching at the beginning of the string) searched for '[0-9]'.
Actually, that's not entirely true. What I did was enter all of those arguments and click the 'Replace' button.
I realized my error a split-second later, but it was too late. MT was off and running on my request to replace every digit in every post title I've ever written with nothing. Fortunately, I also hit the 'Search' button immediately after clicking 'Replace,' so I was provided with search results of all the posts that had now been stripped of their digits.
So what am I doing now? Parsing the list of search results and comparing it against the (thankfully) not-yet rebuilt web archives to re-insert all of the missing digits.
As the MT interface says, "be careful when doing a replace, because there is no undo. If you are making a replacement in many of your entries, you may wish to first use the Export feature to back up your entries."
Later: Everything's fixed, with only a few post titles needing to have been edited at all.
