diff app/views/tweets/_tweet.atom.erb @ 172:df4be896ab8b

Improved escaping and truncating
author nanaya <me@nanaya.pro>
date Wed, 08 Aug 2018 20:37:29 +0900
parents 0c60db0a3686
children 70e90ea4b870
line wrap: on
line diff
--- a/app/views/tweets/_tweet.atom.erb	Wed Aug 08 20:19:51 2018 +0900
+++ b/app/views/tweets/_tweet.atom.erb	Wed Aug 08 20:37:29 2018 +0900
@@ -3,7 +3,7 @@
   <published><%= tweet.created_at.xmlschema %></published>
   <updated><%= tweet.created_at.xmlschema %></updated>
   <link rel="alternate" type="text/html" href="<%= tweet.uri %>"/>
-  <title><%= ellipsize tweet.attrs[:full_text] %></title>
+  <title><%= truncate tweet.unescaped_text, :length => 30 %></title>
   <content type="xhtml">
     <div xmlns="http://www.w3.org/1999/xhtml">
       <%= render :partial => "tweet", :formats => :html, :locals => { :tweet => tweet } %>