slime-lang / slime

Minimalistic HTML templates for Elixir, inspired by Slim.
http://slime-lang.com
MIT License
371 stars 57 forks source link

Strip CR from parsed document #108

Closed sztosz closed 8 years ago

sztosz commented 8 years ago

PR for issue #107

Remove all carriage return characters from parsed document to matanin compatibility with editors working under Windows operating system. For Windows CRLF is default line ending, and simplest way to handle that is to simply remove all CR characters by using regex. If document has only LF line endings then convert_crlf_to_lf will simply return original document, because nothing is going to be replaced.

doomspork commented 8 years ago

Thank you @sztosz. @Rakoth any thoughts on this?

Rakoth commented 8 years ago

A test would be nice (example in slim-rb https://github.com/slim-template/slim/blob/94aa6274e51daa504e87ef193ca464548ced5004/test/core/test_encoding.rb#L4)

sztosz commented 8 years ago

I added test.

Rakoth commented 8 years ago

@doomspork lgtm

doomspork commented 8 years ago

Thank you @sztosz and @Rakoth 👍