judofyr / temple

Template compilation framework in Ruby
http://judofyr.net/posts/temple.html
MIT License
491 stars 53 forks source link

prevent duplicating newlines in ERB outupt. #116

Open arBmind opened 7 years ago

arBmind commented 7 years ago
kbrock commented 6 years ago

are there any tests for this?

arBmind commented 6 years ago

I ran into this with our modified version of comfortable-mexican-sofa. https://github.com/hicknhack-software/comfortable-mexican-sofa/commit/61d43978e741340ffed28026401b5f3689324486 (This adds this PR as a workaround.)

There is only one test for the ERB generator. I have now added a unit test.

I think it would be wise to add an integration test. But the ERB parser right now, does not generate any newline expressions. SLIM generates a lot of them.

It seems there are not many use cases for the ERB generator. But if this feature is here, it should work properly.