From 563d706886531b0d5a307c5599333ac4611faa1b Mon Sep 17 00:00:00 2001 From: YoheiZuho Date: Mon, 16 May 2022 13:23:03 +0900 Subject: [PATCH] test --- app/lib/text_formatter.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/lib/text_formatter.rb b/app/lib/text_formatter.rb index f3378d165..1e12cad9a 100644 --- a/app/lib/text_formatter.rb +++ b/app/lib/text_formatter.rb @@ -21,6 +21,8 @@ class TextFormatter # @option options [Boolean] :with_domains # @option options [Boolean] :with_rel_me # @option options [Array] :preloaded_accounts + # @option options [Status] :quote + def initialize(text, options = {}) @text = text @options = DEFAULT_OPTIONS.merge(options) @@ -30,8 +32,8 @@ class TextFormatter @entities ||= Extractor.extract_entities_with_indices(text, extract_url_without_protocol: false) end - def to_s(status, **options) - return ''.html_safe if text.blank? & !status.quote? + def to_s + return ''.html_safe if text.blank? & !quote? html = rewrite do |entity| if entity[:url] @@ -43,7 +45,7 @@ class TextFormatter end end - html += quotify if status.quote? + html += quotify if quote? html = simple_format(html, {}, sanitize: false).delete("\n") if multiline?