In a display template (a filter item template to be precise), I observe a weird behavior with for loops.
Let's say my template consists in:
<div id="CustomRefinement">
<!--#_
for(var x=0;x<10;x++ ){
}
for(var y=0;y<10;y++){
}
_#-->
</div>
It's transformed like this:
for(var x=0;x<10;x++ ){
}
for(var y="0;y<10;y++){"
}
(notice the quotes in the 2nd for loop)
However, if I add spaces like this :
<div id="CustomRefinement">
<!--#_
for(var x=0 ; x < 10 ; x++ ){
}
for(var y=0 ; y < 10 ; y++){
}
_#-->
</div>
It's transformed as:
for(var x=0 ; x < 10 ; x++ ){
}
for(var y=0 ; y < 10 ; y++){
}
Is there any reason explaining this behavior? Is there any other subtility to be aware of?