I am working on a project on both Mac and Windows. If I build my project on the Mac, Handlebars templates result in translated line-breaks to strings containing LF (line-feed) characters. If I perform the same step on Windows it translates line-breaks to strings containing CRLF (carriage-return and line-feed) character strings.
It is not clear where the source of the problem is whether it is Handlebars, Node, Cygwin, Cake or Git. Intuitively I might expect that Handlebars is based on the precise nature of the templates and Git is automatically converting new lines for the templates to CRLF or LF depending on which machine I'm on.
For example, difference in Handlebars output on the two machines:
Mac (LF):
function program1(depth0,data)
{
var buffer = "", stack1;
buffer += "\n ";
stack1 = helpers.each.call(depth0, depth0.produces, {hash:{},inverse:self.noop,fn:self.program(2, program2, data),data:data});
if(stack1 || stack1 === 0) { buffer += stack1; }
buffer += "\n";
return buffer;
}
Windows (CRLF):
function program1(depth0,data)
{
var buffer = "", stack1;
buffer += "\r\n ";
stack1 = helpers.each.call(depth0, depth0.produces, {hash:{},inverse:self.noop,fn:self.program(2, program2, data),data:data});
if(stack1 || stack1 === 0) { buffer += stack1; }
buffer += "\r\n";
return buffer;
}
How do I control this behavior so that it is consistent and not platform dependent?