diff --git a/app/views/tag/show.html.erb b/app/views/tag/show.html.erb index 0d1c8a186d..bfc214eef5 100644 --- a/app/views/tag/show.html.erb +++ b/app/views/tag/show.html.erb @@ -10,13 +10,13 @@

<%= link_to @wiki.latest.title, "/wiki/#{params[:id]}" %>

- <%= (@wiki.latest.render_body.match(/

(.+)<\/p>/).first + '

').html_safe %> + <%= @wiki.latest.render_body.html_safe.match(/

(.+)<\/p>/).to_a.try(:first) %> <%= link_to("Read More", "/wiki/#{params[:id]}") if @wiki.latest.render_body.split('

').length > 2 %>
<% else %>

<%= @wiki.latest.title %>

-

<%= @wiki.latest.render_body.split('\n').first.html_safe %>

+

<%= @wiki.latest.render_body.html_safe.match(/

(.+)<\/p>/).to_a.try(:first) %>

<%= link_to("Read More »", "/wiki/#{params[:id]}") if @wiki.latest.render_body.split('\n').length > 1 %>

<% end %>