Module: HtmlWhitespaceCleaner

Defined in:
lib/html_whitespace_cleaner.rb,
lib/html_whitespace_cleaner/version.rb

Overview

This module contains the public interface #clean and some private methods used within it.

Constant Summary collapse

VERSION =
"1.0.1"

Class Method Summary collapse

Class Method Details

.clean(html_string) ⇒ Object

Takes a string of html code and returns the same code but with extra whitespace removed.

It only removes whitespace between html tags. Formatting within tags is preserved.



15
16
17
# File 'lib/html_whitespace_cleaner.rb', line 15

def self.clean(html_string)
  remove_all_white_space_between_tags(condense_whitespace(html_string)).strip
end