BorisMoore/jsrender — Issue #17: Error: Unterminated string constant in IE7
Author: JasonBro
Created: 2011-11-07 15:41:37+00:00
State: open

Hi Boris,

When I run the current version of JSRender's 01_inserting-data.html page I get an Error: Unterminated string constant exception due to newlines in the generated function javascript. I fixed it by changing the end of the buildTmplFunction function to

try {
ret = new Function("$data, $view", (code.slice(0, -1) + ";return result;\n\n}catch(e){return views.err(e);}").replace(/\n|\r/g, " "));
} catch(e) {

...but this might not be the best way to fix it!

Cheers

Jason