Skip to content

Commit

Permalink
Update tags/show.html.erb (publiclab#1015)
Browse files Browse the repository at this point in the history
* Update show.html.erb

* Update show.html.erb
  • Loading branch information
jywarren authored Nov 23, 2016
1 parent 1b54dbf commit bb08695
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/views/tag/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
</div>
<div class="col-md-8">
<h2><%= link_to @wiki.latest.title, "/wiki/#{params[:id]}" %></h2>
<%= (@wiki.latest.render_body.match(/<p>(.+)<\/p>/).first + '</p>').html_safe %>
<%= @wiki.latest.render_body.html_safe.match(/<p>(.+)<\/p>/).to_a.try(:first) %>
<%= link_to("Read More", "/wiki/#{params[:id]}") if @wiki.latest.render_body.split('</p>').length > 2 %>
</div>
</div>
<% else %>
<h2><%= @wiki.latest.title %></h2>
<p><%= @wiki.latest.render_body.split('\n').first.html_safe %></p>
<p><%= @wiki.latest.render_body.html_safe.match(/<p>(.+)<\/p>/).to_a.try(:first) %></p>
<p><%= link_to("Read More &raquo;", "/wiki/#{params[:id]}") if @wiki.latest.render_body.split('\n').length > 1 %></p>
<% end %>
</div>
Expand Down

0 comments on commit bb08695

Please sign in to comment.