From ecb99b433eca950756431ac57af2eeffa4112dcc Mon Sep 17 00:00:00 2001 From: YoheiZuho Date: Mon, 16 May 2022 12:56:23 +0900 Subject: [PATCH] test --- app/lib/quote_formatter.rb | 11 ++++++----- app/lib/text_formatter.rb | 8 -------- 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/app/lib/quote_formatter.rb b/app/lib/quote_formatter.rb index d51f938b5..f73f39cfd 100644 --- a/app/lib/quote_formatter.rb +++ b/app/lib/quote_formatter.rb @@ -10,11 +10,12 @@ class QuoteFormatter end def to_s - return html if status.quote? && !options[:escape_quotify] - - url = ActivityPub::TagManager.instance.url_for(status.quote) - link = encode_and_link_urls(url) - html.sub(/(<[^>]+>)\z/, "
QT: #{link}
\\1") + def render_quote + link = link_to_url({ url: ap_tag_manager.url_for(quote) }) + <<~HTML.squish +
~~~~~~~~~~
[#{link}]
+ HTML + end end def format_in_quote(status, **options) diff --git a/app/lib/text_formatter.rb b/app/lib/text_formatter.rb index bf513be23..53f3ecf35 100644 --- a/app/lib/text_formatter.rb +++ b/app/lib/text_formatter.rb @@ -128,14 +128,6 @@ class TextFormatter HTML end - def quotify - url = ActivityPub::TagManager.instance.url_for(status.quote) - link = encode_and_link_urls(url) - <<~HTML.squish -
QT: #{link}
" - HTML - end - def entity_cache @entity_cache ||= EntityCache.instance end