about summary refs log tree commit diff
path: root/app/lib
diff options
context:
space:
mode:
Diffstat (limited to 'app/lib')
-rw-r--r--app/lib/formatter.rb6
-rw-r--r--app/lib/sanitize_config.rb2
2 files changed, 7 insertions, 1 deletions
diff --git a/app/lib/formatter.rb b/app/lib/formatter.rb
index bf99701b7..dec60a3ea 100644
--- a/app/lib/formatter.rb
+++ b/app/lib/formatter.rb
@@ -76,6 +76,7 @@ class Formatter
     end
 
     html = format_article_content(summary, html) if options[:article_content] && summary.present?
+    html = format_article_summary(html, status) if !options[:article_content] && summary.present?
     html.html_safe # rubocop:disable Rails/OutputSafety
   end
 
@@ -89,6 +90,11 @@ class Formatter
     text.html_safe # rubocop:disable Rails/OutputSafety
   end
 
+  def format_article_summary(html, status)
+    status_url = ActivityPub::TagManager.instance.url_for(status)
+    "#{html}\n<p data-name=\"permalink\"><span>📄&nbsp;</span>#{link_url(status_url)}</p>"
+  end
+
   def format_article_content(summary, html)
     "<blockquote data-name=\"summary\">#{format_summary(summary, html)}</blockquote>#{html}"
   end
diff --git a/app/lib/sanitize_config.rb b/app/lib/sanitize_config.rb
index 102dce2d2..93260c7dc 100644
--- a/app/lib/sanitize_config.rb
+++ b/app/lib/sanitize_config.rb
@@ -43,7 +43,7 @@ class Sanitize
       return unless name_list
 
       name_list.keep_if do |name|
-        next true if %w(summary abstract).include?(name)
+        next true if %w(summary abstract permalink).include?(name)
       end
 
       node['data-name'] = name_list.join(' ')