This problem is especially serious when you change extension from .html to .xhtml in ikiwiki.setup and use Firefox. Since Firefox will display a error message only for not well-formed application/xhtml+xml pages.
It seems that HTML::Template also support <!--Variable--> syntax instead of <Variable>. Chaning to this syntax will solve this problem, I guess.
+
+
+Even if changed to <!-- TMPL_VAR --> style, the problem may still exist if the template contains if else block.
+
+Maybe just encode all < and > when compling pages within the templates folder will solve this problem.