diff --git a/app/services/content_formatter_service.rb b/app/services/content_formatter_service.rb index 32a79399..5c20cd97 100644 --- a/app/services/content_formatter_service.rb +++ b/app/services/content_formatter_service.rb @@ -20,7 +20,7 @@ class ContentFormatterService < Service def self.show(text:, viewing_user: User.new) # We want to evaluate markdown first, because the markdown engine also happens # to strip out HTML tags. So: markdown, _then_ insert content links. - formatted_text = markdown.render(text).html_safe + formatted_text = markdown.render(text || '').html_safe substitute_content_links(formatted_text, viewing_user).html_safe end diff --git a/app/views/content/list/_cards.html.erb b/app/views/content/list/_cards.html.erb index f63962b4..e419e584 100644 --- a/app/views/content/list/_cards.html.erb +++ b/app/views/content/list/_cards.html.erb @@ -20,7 +20,7 @@ <% if content.is_a?(Document) %> <%= content.reading_estimate %> <% else %> - <%= content.description %> + <%= ContentFormatterService.show(text: content.description, viewing_user: current_user) %> <% end %>
@@ -71,19 +71,22 @@ <% end %> -- add -
+ <% if current_user.can_create?(content_type) %> ++ add +
+