diff config/initializers/ext_twitter_tweet.rb @ 172:df4be896ab8b

Improved escaping and truncating
author nanaya <me@nanaya.pro>
date Wed, 08 Aug 2018 20:37:29 +0900
parents
children d35dbc09bd83
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/config/initializers/ext_twitter_tweet.rb	Wed Aug 08 20:37:29 2018 +0900
@@ -0,0 +1,7 @@
+class Twitter::Tweet
+  def unescaped_text
+    CGI.unescapeHTML attrs[:full_text].printable
+  end
+
+  memoize :unescaped_text
+end