conred 0.0.14 → 0.0.15
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/conred/helpers.rb +2 -0
- data/lib/conred/version.rb +1 -1
- metadata +1 -1
data/lib/conred/helpers.rb
CHANGED
@@ -11,6 +11,7 @@ module Conred
|
|
11
11
|
end
|
12
12
|
|
13
13
|
def sanitize_and_trim(text = "", word_count = nil, omission = '...')
|
14
|
+
text = "" if text == nil
|
14
15
|
text = action_view.strip_tags(text)
|
15
16
|
if word_count
|
16
17
|
action_view.truncate(text, :length => word_count, :omission => omission).html_safe
|
@@ -20,6 +21,7 @@ module Conred
|
|
20
21
|
end
|
21
22
|
|
22
23
|
def sanitize_body(text = "")
|
24
|
+
text = "" if text == nil
|
23
25
|
text = action_view.sanitize(text, :tags => %w(p a strong ul ol li blockquote strike u em), :attributes => %w(href))
|
24
26
|
text.html_safe
|
25
27
|
end
|
data/lib/conred/version.rb
CHANGED