Module: Postablr::BlogHelper

Defined in:
app/helpers/postablr/blog_helper.rb

Instance Method Summary collapse

Instance Method Details

#clean_html(html) ⇒ Object



19
20
21
# File 'app/helpers/postablr/blog_helper.rb', line 19

def clean_html(html)
  Sanitize.clean(html, Sanitize::Config::BASIC)
end

#sanitize_clean(html, truncate = false, link = nil) ⇒ Object



3
4
5
6
7
8
9
# File 'app/helpers/postablr/blog_helper.rb', line 3

def sanitize_clean(html, truncate = false, link=nil)
  unless truncate
    Sanitize.clean(html, Sanitize::Config::RESTRICTED)
  else
    truncate_html(clean_html( html ), truncate , link )
  end
end

#sanitize_relaxed(html) ⇒ Object



23
24
25
# File 'app/helpers/postablr/blog_helper.rb', line 23

def sanitize_relaxed(html)
  Sanitize.clean(html, Sanitize::Config::RELAXED)
end

#sanitize_strict(html, truncate = false, link = nil) ⇒ Object



11
12
13
14
15
16
17
# File 'app/helpers/postablr/blog_helper.rb', line 11

def sanitize_strict(html, truncate = false, link=nil)
  unless truncate
    Sanitize.clean(html, Sanitize::Config::RESTRICTED)
  else
    truncate_html(Sanitize.clean(html, Sanitize::Config::RESTRICTED), truncate , link )
  end
end