Whitespace-only TemplateData nodes should not be completely stripped.

I realized that this isn't entirely safe, so I'm replacing it with the safer-er version of the optimization.