Japid icon indicating copy to clipboard operation
Japid copied to clipboard

Extra newline at the beginning

Open marekk opened this issue 13 years ago • 2 comments

There's an extra newline added at the beginning of compiled template.

@(String name) Hello $name

becomes

p("\n" + "Hello ");// line 1 p(name);// line 2

I suppose this might be the newline after param list declaration, but as there must be newline after this declaration, it should be ignored.

The engine might be used to render other outputs then html, where whitespace is important.

marekk avatar Jan 14 '13 12:01 marekk

I'll take a look. Thanks!

2013/1/14 marekk [email protected]

There's an extra newline added at the beginning of compiled template.

@(String name) Hello $name

becomes

p("\n" + "Hello ");// line 1 p(name);// line 2

I suppose this might be the newline after param list declaration, but as there must be newline after this declaration, it should be ignored.

The engine might be used to render other outputs then html, where whitespace is important.

— Reply to this email directly or view it on GitHubhttps://github.com/branaway/Japid/issues/52.

branaway avatar Jan 14 '13 13:01 branaway

I see what the issue is.

In the interim, there is an "old" syntax you can use that does not have this problem:

`args String s, int i ...

branaway avatar Jan 14 '13 16:01 branaway