Admin Forum:Weird effect with the if parser function

I've been working with parser functions for years now and I've never seen anything like this before. It's gotta be some kinda bug, but I wanted to run it past people smarter than me before I reported. I have a simple link template called tardis:template:Delgado. It's basic function is to link to a particular part of the article tardis:the Master having to do with the interpretation by an actor named tardis:Roger Delgado. So basically, you type Delgado and it creates a link displaying as "the Master" but pointing towards a particular section of an article. Fine. Straightforward enough.

But, I wanted to be able to account for the fact that sometimes you need to be able to create a link for The Master, so that you can start a sentence with a capital The.

So here's the simple #if of it all:

Seems like it'd work, right? And it does — for the first option. If you type, you get a proper section link. But if you just type you just get a link to the Master.

I couldn't understand it, so I dug deeper and then found that if there was no space in the second display statement, the link was fine. Which means that the following two things work:

[I should point out that there's an & n b s p; between "the" and "Master" in the last example, but it's not showing up after publishing.]

So my question is why? Why is the space okay in the first condition, but not in the second? I've never seen an #if statement be so finicky with spaces like this. Is this a MW 1.19 bug? 23:01: Fri 16 Nov 2012