about summary refs log tree commit diff
path: root/app/lib
diff options
context:
space:
mode:
authorAkihiko Odaki (@fn_aki@pawoo.net) <akihiko.odaki.4i@stu.hosei.ac.jp>2017-06-04 21:58:57 +0900
committerEugen Rochko <eugen@zeonfederated.com>2017-06-04 14:58:57 +0200
commitc7af8cbc9081f349461634db0a1d76bc689d8dd5 (patch)
treea67accc9dcd33856605ab222cc9ab4bafead3a3c /app/lib
parent9475fbae78db2aad6b4d4d5ad29a7e724dc7b4bd (diff)
Remove some arguments of Formatter.instance.format and spec (#3541)
* Remove some arguments of Formatter.instance.format

* Improve spec for Formatter
Diffstat (limited to 'app/lib')
-rw-r--r--app/lib/formatter.rb7
1 files changed, 3 insertions, 4 deletions
diff --git a/app/lib/formatter.rb b/app/lib/formatter.rb
index 43d23db96..7b89305ac 100644
--- a/app/lib/formatter.rb
+++ b/app/lib/formatter.rb
@@ -9,7 +9,7 @@ class Formatter
 
   include ActionView::Helpers::TextHelper
 
-  def format(status, attribute = :text, paragraphize = true)
+  def format(status)
     if status.reblog?
       prepend_reblog = status.reblog.account.acct
       status         = status.proper
@@ -17,9 +17,8 @@ class Formatter
       prepend_reblog = false
     end
 
-    raw_content = status.public_send(attribute)
+    raw_content = status.text
 
-    return '' if raw_content.blank?
     return reformat(raw_content) unless status.local?
 
     linkable_accounts = status.mentions.map(&:account)
@@ -28,7 +27,7 @@ class Formatter
     html = raw_content
     html = "RT @#{prepend_reblog} #{html}" if prepend_reblog
     html = encode_and_link_urls(html, linkable_accounts)
-    html = simple_format(html, {}, sanitize: false) if paragraphize
+    html = simple_format(html, {}, sanitize: false)
     html = html.delete("\n")
 
     html.html_safe # rubocop:disable Rails/OutputSafety