BeautifyRuby icon indicating copy to clipboard operation
BeautifyRuby copied to clipboard

Add option to prevent deletion of empty lines

Open h0jeZvgoxFepBQ2C opened this issue 11 years ago • 11 comments

I would like to prevent the deleting of empty lines, especially in erb files its sometimes more comfortable to read parts if there are empty lines.

at the moment all empty lines are removed..

Could you maybe add an option?

thanks!

h0jeZvgoxFepBQ2C avatar Jul 24 '13 08:07 h0jeZvgoxFepBQ2C

the beautifyer also deletes newlines at the end of a ruby file. git does not like that very much.

maybe @CraigWilliams can point me to some place in the code where i can add configurations to handle that.

phoet avatar Nov 05 '13 10:11 phoet

I am getting an extra line at the end of the file now. Can you confirm this to be true for you?

CraigWilliams avatar Dec 06 '13 01:12 CraigWilliams

Works fine (line at the end not removed).

h0jeZvgoxFepBQ2C avatar Dec 07 '13 14:12 h0jeZvgoxFepBQ2C

But the ticket was originally for an option to keep empty lines in the code - and this is not implemented?

h0jeZvgoxFepBQ2C avatar Dec 07 '13 15:12 h0jeZvgoxFepBQ2C

+1 on this feature -- especially in .html.erb files. Thanks for the great work everyone. :)

kemallette avatar Dec 16 '14 22:12 kemallette

+1 for sure

Also, for some reason, the line at the end DOES get removed for me. Anybody here still has the issue?

petrpacas avatar May 26 '16 11:05 petrpacas

+1 Also have the issue with the end line DOES get removed. Thanks as well!

mtomov avatar Mar 17 '17 08:03 mtomov

+1 any news?

NaldoColella avatar Apr 10 '17 20:04 NaldoColella

+1. It looks like htmlbeautifier already supports this so it's just a matter of piping it in: https://github.com/threedaymonk/htmlbeautifier/blob/4f4fa8c293f42e5475370d3bd8595eec2f4171d0/lib/htmlbeautifier.rb#L18

Are pull requests for this welcome?

mejibyte avatar Jul 29 '17 20:07 mejibyte

I solved this in my fork with this patch: https://github.com/andmej/BeautifyRuby/commit/b5d042ea15d97c5907388d03173977d4f493aac0

mejibyte avatar Jul 29 '17 20:07 mejibyte

@andmej why not pull request your feature? :+1: :)

benkoshy avatar Mar 29 '18 05:03 benkoshy