lua-resty-template icon indicating copy to clipboard operation
lua-resty-template copied to clipboard

Different output with precompiled Lua code

Open decadence opened this issue 3 years ago • 1 comments

Let's say I have this code in template

// {# comment #}
console.log(name);

Which correctly compiles to

//
console.log(name);

But if I enable precompilation of Lua byte code (content_by_lua_file) it compiles to

// console.log(name);

As you can see bottom line pops up to comment line and this breaks JavaScript code.

As far as I know it happens if you have newline character after comment block without any other characters.

Precompilation: https://blog.openresty.com/en/luajit-bytecode/

decadence avatar May 08 '22 11:05 decadence

@decadence, great feedback! that nice! let me see if I can do something about it.

bungle avatar May 25 '22 13:05 bungle