3

after googling around with no success i try it here. i'm looking for a rails gem, which removes whitespace from rendered ERB templates, so code structure etc. gets removed, just compressed html code. any tip here?

thanks in advance

trnc
  • 20,581
  • 21
  • 60
  • 98
  • I assume you know about closing `<% -%>` tags. But removing *all* whitespace is potentially risky as different browsers do different things with whitespace, under different circumstances. You could probably put something into rack, but... wouldn't gzipping the entire response be a better solution? – Dave Newton Sep 16 '11 at 13:25

1 Answers1

2

You might be interested in this, a Rack middleware which cleans text/html markup by automatically indenting and reformatting content:

http://coderack.org/users/webficient/middlewares/38-racktidy

acw
  • 1,093
  • 10
  • 14
Andres Diez
  • 173
  • 1
  • 11