comparison app/views/tweets/_tweet.html.erb @ 172:df4be896ab8b

Improved escaping and truncating
author nanaya <me@nanaya.pro>
date Wed, 08 Aug 2018 20:37:29 +0900
parents 04ca6c4f11d0
children d35dbc09bd83
comparison
equal deleted inserted replaced
171:90db232f39e7 172:df4be896ab8b
11 </p> 11 </p>
12 <% end %> 12 <% end %>
13 13
14 <p> 14 <p>
15 <%# FIXME: Twitter gem doesn't support extended mode when writing this %> 15 <%# FIXME: Twitter gem doesn't support extended mode when writing this %>
16 <%= auto_link(expand_url( 16 <%= auto_link(html_escape(expand_url(
17 tweet.attrs[:full_text].printable, 17 tweet.unescaped_text,
18 tweet.attrs[:entities][:urls], 18 tweet.attrs[:entities][:urls],
19 tweet.attrs[:entities][:media] 19 tweet.attrs[:entities][:media]
20 )) 20 )))
21 .gsub("\n", "<br />") 21 .gsub("\n", "<br />")
22 .html_safe 22 .html_safe
23 %> 23 %>
24 </p> 24 </p>
25 25