-
- <%= entry.headline %>
- <%- if entry.published?%>
- Published on <%= link_to entry.published_at.to_fs(:long_ordinal), entry.location %>
- <%- else %>
- Unpublished.
- <%- end %>
-
-
-
- <%= entry.to_html.html_safe %>
-
-
-
-
+<%= render Journal::EntryComponent.new(entry: entry) %>
diff --git a/app/furniture/journal/entry.rb b/app/furniture/journal/entry.rb
index 7e51b67ae..f75c5f84a 100644
--- a/app/furniture/journal/entry.rb
+++ b/app/furniture/journal/entry.rb
@@ -3,7 +3,6 @@ class Entry < ApplicationRecord
location(parent: :journal)
self.table_name = "journal_entries"
- include RendersMarkdown
extend StripsNamespaceFromModelName
scope :recent, -> { order("published_at DESC NULLS FIRST") }
@@ -38,21 +37,6 @@ def published?
published_at.present?
end
- def to_html
- render_markdown(body)
- end
-
- def self.renderer
- @_renderer ||= Redcarpet::Markdown.new(
- Renderer.new(filter_html: true, with_toc_data: true),
- autolink: true, strikethrough: true,
- no_intra_emphasis: true,
- lax_spacing: true,
- fenced_code_blocks: true, disable_indented_code_blocks: true,
- tables: true, footnotes: true, superscript: true, quote: true
- )
- end
-
def extract_keywords
self.keywords = journal.keywords.extract_and_create_from!(body).pluck(:canonical_keyword)
end
diff --git a/app/furniture/journal/entry_component.html.erb b/app/furniture/journal/entry_component.html.erb
new file mode 100644
index 000000000..02dc3f235
--- /dev/null
+++ b/app/furniture/journal/entry_component.html.erb
@@ -0,0 +1,27 @@
+