|
@@ -12,7 +12,7 @@ module PostsHelper |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
:text => { |
|
|
:text => { |
|
|
:title => post.title, |
|
|
|
|
|
|
|
|
:title => decode_entities(post.title), |
|
|
:description => clean_description(post.summary), |
|
|
:description => clean_description(post.summary), |
|
|
:footnote => "From #{post.feed.title}" |
|
|
:footnote => "From #{post.feed.title}" |
|
|
}, |
|
|
}, |
|
@@ -28,12 +28,15 @@ module PostsHelper |
|
|
} |
|
|
} |
|
|
end |
|
|
end |
|
|
|
|
|
|
|
|
|
|
|
def decode_entities(s) |
|
|
|
|
|
HTMLEntities.new.decode s |
|
|
|
|
|
end |
|
|
|
|
|
|
|
|
def clean_description(s) |
|
|
def clean_description(s) |
|
|
if s.size > 137 |
|
|
if s.size > 137 |
|
|
s = s[0..136] + '...' |
|
|
s = s[0..136] + '...' |
|
|
end |
|
|
end |
|
|
|
|
|
|
|
|
coder = HTMLEntities.new |
|
|
|
|
|
coder.decode(s.gsub(/<.+?>/, '')) |
|
|
|
|
|
|
|
|
decode_entities(s.gsub(/<.+?>/, '')) |
|
|
end |
|
|
end |
|
|
end |
|
|
end |