The string interpolation syntax is #{variable}
, not !{variable}
:
li(class='#{i}') !{i}
// or simply
li(class=i) !{i}
Also, when you use !{i}
vs #{i}
for the content of the li
, the former will have HTML entities escaped while the latter will not.