Re: [Haserl-users] haserl / lua eats my newline?
Brought to you by:
nangel
|
From: Nico de H. <nic...@gm...> - 2022-01-26 22:12:24
|
Hi Ralph, As you point out the EVAL translates to 'echo -n' and does not include a newline - this is what I expect and I think that that is the way it should work. My point is... why is the newline after the <%= foo %> no longer there. Looking at the output with the debug flag set: ~~~~~ code ~~~~~ io.write([=[content-type: text/plain ]=]) foo="bar" io.write([=[ The value of foo is ]=]) io.write(tostring( foo )) io.write([=[. Note that this in the middle of a line Wat is the value of foo? ]=]) io.write(tostring( foo )) io.write([=[ Hey, where did my newline go? ]=]) ~~~~~~~~~~~~~~~ Looks like the io.write starts with a newline but that newline does not end up in the output. I ran some extra tests using just lua and I found that these two bits of lua (Note the extra newline at the start of the 2nd io.write) give the same output: ~~~~~~~~~~~~~~~ io.write([=[This is a line ]=]) io.write([=[ This is a line ]=]) ~~~~~~~~~~~~~~~ Looks like lua itself is eating the newline. Regards, Nico |