class SiSU_HTML_Tune::CleanHTML

Public Class Methods

new(html='') click to toggle source
# File lib/sisu/html_tune.rb, line 97
def initialize(html='')
  @html=html
end

Public Instance Methods

clean() click to toggle source
# File lib/sisu/html_tune.rb, line 110
def clean
  html=@html
  str=if html.is_a?(String)
    html
  else html.obj
  end
  str=str.gsub(/#{Mx[:gl_o]}(#[0-9]{3})#{Mx[:gl_c]}/u,'&\1;').
    gsub(/#{Mx[:gl_o]}#([a-z]{2,4})#{Mx[:gl_c]}/u,'&\1;').
    gsub(/[\\]{2}/m,'<br>')
end
clean_for_html() click to toggle source
# File lib/sisu/html_tune.rb, line 100
def clean_for_html
  html=@html
  str=if html.is_a?(String)
    html
  else html.obj
  end
  str=str.gsub(/#{Mx[:gl_o]}(#[0-9]{3})#{Mx[:gl_c]}/u,'&\1;').
    gsub(/#{Mx[:gl_o]}#([a-z]{2,4})#{Mx[:gl_c]}/u,'&\1;').
    gsub(/[<]/m,'&lt;').gsub(/[>]/m,'&gt;')
end