discourse/app/views/categories/index.html.erb
Ryan Mulligan f3f7dd02d1 safely call html_safe on category description
The `categories.description` column is not modified as "not null", so it is possible for the description to be nil. This changes the code not call html_safe on nil.
2017-07-25 11:40:02 -07:00

19 lines
773 B
Plaintext

<div class='category-list' itemscope itemtype='http://schema.org/ItemList'>
<meta itemprop='itemListOrder' content='http://schema.org/ItemListOrderDescending'>
<% @category_list.categories.each do |c| %>
<div class='category' itemprop='itemListElement' itemscope itemtype='http://schema.org/ListItem'>
<meta itemprop='url' content='<%= c.url %>'>
<h2><a href='<%= c.url %>' itemprop='item'>
<span itemprop='name'><%= c.name %></span>
</a></h2>
<span itemprop='description'><%= c.description&.html_safe %></span>
</div>
<% end %>
</div>
<% content_for :title do %><%= @title %><% end %>
<% content_for :head do %>
<%= raw crawlable_meta_data(title: SiteSetting.title, description: SiteSetting.site_description) %>
<% end %>