jehugaleahsa / mustache-sharp

An extension of the mustache text template engine for .NET.
The Unlicense
306 stars 78 forks source link

Add option to not have to use the {{#newline}} placeholder #18

Closed jcreamer898 closed 10 years ago

jcreamer898 commented 10 years ago

It would be great to have a compile option to be able to omit the {{#newline}}.

I was using this to simply grab the content of a file and render it against a class, and seeing the new line place holder everywhere gets a bit daunting.

lelandrichardson commented 10 years ago

I think this would be a great addition as well.

Having some option like ExplicitNewline = false or something that was true by default would be useful for the cases where the newlines in the template are actually what you want (for instance, in HTML rendering, and many text-file rendering scenarios)

Edit: this could also have the added benefit of reusing templates between mustache# and mustache.js

crwang commented 10 years ago

Hi guys, I think you could get into the code and do it very quickly and then submit a pull request.

I'm waiting on feedback from @jehugaleahsa before I make more changes to see how he wants to manage the library, but adding an option for the newline seems like an easy change.

jehugaleahsa commented 10 years ago

Go ahead. On Jan 28, 2014 9:04 PM, "crwang" notifications@github.com wrote:

Hi guys, I think you could get into the code and do it very quickly and then submit a pull request.

I'm waiting on feedback from @jehugaleahsahttps://github.com/jehugaleahsabefore I make more changes to see how he wants to manage the library, but adding an option for the newline seems like an easy change.

Reply to this email directly or view it on GitHubhttps://github.com/jehugaleahsa/mustache-sharp/issues/18#issuecomment-33549819 .

nikkilocke commented 10 years ago

I have added a new FormatCompiler property RemoveNewLines in my branch - if you set that to false, it will stop removing newlines from the input text.