/razor/pitfalls/semicolon
////////////////////////////////////////////////
// Example of missing semicolon error in Razor-Express.
// https://www.npmjs.com/package/raz
////////////////////////////////////////////////
// Semicolon is missed at the end of the line of code "var text = i * i".
const template = `
<ul>
@for(var i = 0; i < 10; i++){
var text = i * i
<li>@text</li>
}
</ul>`;
const razor = require("raz")
try{
var html = razor.compileSync({ template });
}
catch(err){
console.log(err);
}
no comments