fixed a bug when displaying the template and snippet demos