module Compostr::WPString

Public Class Methods

wp_string(string) click to toggle source
# 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