valyala / quicktemplate

Fast, powerful, yet easy to use template engine for Go. Optimized for speed, zero memory allocations in hot paths. Up to 20x faster than html/template

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Question] leading new line

pot-code opened this issue · comments

say I have a definition:

{% func NodeTsConfig() %}
{
  "compilerOptions": {
    "module": "commonjs",
    "declaration": true,
    "removeComments": true,
    "allowSyntheticDefaultImports": true,
    "target": "es2017",
    "sourceMap": true,
    "outDir": "./dist",
    "baseUrl": "./",
    "incremental": true,
    "esModuleInterop": true,
  }
}
{% endfunc %}

it will include an unnecessary newline in the output file, but the doc only introduces some ways to get rid of the spaces. is there any way to strip the leading line? thanks

Try to close first line with '-%}'.

{% func NodeTsConfig() -%}
{

Finally!

@turutcrane thank you!