Permalink
Browse files

Add auto-linking to notes

  • Loading branch information...
adamdawkins committed Jan 22, 2019
1 parent 9478e4d commit ce414a7b2c3a0366a5267b4f01a5c62a4f19ce59
Showing with 5 additions and 2 deletions.
  1. +3 −0 app/helpers/notes_helper.rb
  2. +1 −1 app/helpers/posts_helper.rb
  3. +1 −1 app/views/notes/_note.html.erb
@@ -1,2 +1,5 @@
module NotesHelper
def note_content(note)
auto_link(note.content)
end
end
@@ -18,7 +18,7 @@ def auto_link(content)
content.gsub!(address, autolink_tag(uri, display_text))
end
end
content
content.html_safe
end

def strip_protocol(url)
@@ -11,7 +11,7 @@
</time>
<% end %>
<% end %>
<p class="p-name e-content"><%= note.content %></p>
<p class="p-name e-content"><%= note_content(note) %></p>
<% if note.syndicates.any? %>
<footer>
<%= render "syndicates", post: note %>

0 comments on commit ce414a7

Please sign in to comment.