jondot / hygen

The simple, fast, and scalable code generator that lives in your project.
http://www.hygen.io
MIT License
5.68k stars 256 forks source link

[BUGFIX] whitespace error with frontmatter section #440

Open David200197 opened 10 months ago

David200197 commented 10 months ago

Hi, I'm not very good at English, so I'll try to point out the error I found. In frontmatter section, if you leave spaces between line breaks with the "---" symbols, it does not render the template:

// in this case it doesn't work
---                      <----------- whitespace in this line
to: app/<%= name %>/create-<%= name %>-handler.model.ts
---
// in this case it work (no whitespace in next line)
---
to: app/<%= name %>/create-<%= name %>-handler.model.ts
---

I don't know how this library works behind the scenes, but maybe with a .trim(), this error will be solved.

PD: Very good library, I'm using it and it's helping me a lot :)