<% @markdown ||= nil %> <% results.each do |result| %>
<% if result.is_text %> <% elsif result.is_table %> <% else %> <% if result.asset.is_image? %> <% else %> <% end %> <% end %> <%= render partial: "search/results/partials/result_text.html.erb", locals: { result: result, query: search_query, target: nil } %>
<% if result.is_text && result.result_text.text.present? && !result.result_text.text.empty? && @markdown.present? %>

<%= highlight(@markdown.render(result.result_text.text).html_safe, search_query.strip.split(/\s+/)) %>

<% end %>

<%=t "search.index.created_at" %> <%=l result.created_at, format: :full %>
<%=t "search.index.module" %> <%= render partial: "search/results/partials/my_module_text.html.erb", locals: { my_module: result.my_module } %>
<%=t "search.index.experiment" %> <%= render partial: "search/results/partials/experiment_text.html.erb", locals: { experiment: result.my_module.experiment } %>
<%=t "search.index.project" %> <%= render partial: "search/results/partials/project_text.html.erb", locals: { project: result.my_module.experiment.project, link_to_page: :show } %>
<%=t "search.index.organization" %> <%= render partial: "search/results/partials/organization_text.html.erb", locals: { organization: result.my_module.experiment.project.organization } %>


<% end %>