Underscore.js attempts to read commented HTML

April 11th, 2013 by admin Leave a reply »

I just wanted to throw this out there for anybody trying to figure out why their underscore templates may be failing with properties in their commented html.  It looks to me like underscore.js actually parses everything in the html file in certain situations, I am not fully sure yet but I couldn’t really find much on the web that spoke about it.  I thought I would throw this blog post up so anybody noticing this that has seen it before could chime in and offer some insight into this.  What is weird is that it doesn’t always do it, but only seems to when a change is made at some point to the template being rendered, very strange.  I guess for now my only alternative would be to remove the <%= %> in my comments.  If anybody has some alternatives I am all ears.

Advertisement

Leave a Reply