Module: Compostr::WPString

Defined in:
lib/compostr/wp_string.rb

Class Method Summary collapse

Class Method Details

.wp_string(string) ⇒ Object



3
4
5
6
7
8
9
10
11
12
# File 'lib/compostr/wp_string.rb', line 3

def self.wp_string string
  content = string.to_s.strip
  if !content.match(/img/)
    re = /<("[^"]*"|'[^']*'|[^'">])*>/
    if content.gsub(re, '') == ''
      return ''
    end
  end
  content
end