Skip to content

Instantly share code, notes, and snippets.

@huobazi
Forked from huacnlee/spaceless.rb
Created May 16, 2011 02:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save huobazi/973843 to your computer and use it in GitHub Desktop.
Save huobazi/973843 to your computer and use it in GitHub Desktop.
去除区域里面的HTML内容的换行和空白标记
# 去除区域里面的HTML内容的换行和空白标记
def spaceless(&block)
data = with_output_buffer(&block)
data = data.gsub(/>\s+</,"><")
data
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment