Commit 41d05fa8 authored by Phil Hughes's avatar Phil Hughes

Fixed alignment of snippet search results

Also enabled syntaax highlight on the search results

Closes #26832
parent f802ad37
...@@ -12,9 +12,9 @@ ...@@ -12,9 +12,9 @@
%span.light= time_ago_with_tooltip(snippet.created_at) %span.light= time_ago_with_tooltip(snippet.created_at)
%h4.snippet-title %h4.snippet-title
- snippet_path = reliable_snippet_path(snippet) - snippet_path = reliable_snippet_path(snippet)
= link_to snippet_path do
.file-holder .file-holder
.js-file-title.file-title .js-file-title.file-title
= link_to snippet_path do
%i.fa.fa-file %i.fa.fa-file
%strong= snippet.file_name %strong= snippet.file_name
- if markup?(snippet.file_name) - if markup?(snippet.file_name)
...@@ -36,17 +36,10 @@ ...@@ -36,17 +36,10 @@
= link_to snippet_path+"#L#{i}", id: "L#{i}", rel: "#L#{i}", class: "diff-line-num" do = link_to snippet_path+"#L#{i}", id: "L#{i}", rel: "#L#{i}", class: "diff-line-num" do
%i.fa.fa-link %i.fa.fa-link
= i = i
- unless snippet == snippet_chunks.last .blob-content
%a.diff-line-num
= "."
%pre.code
%code
- snippet_chunks.each do |chunk| - snippet_chunks.each do |chunk|
- unless chunk[:data].empty? - unless chunk[:data].empty?
= chunk[:data] = highlight(snippet.file_name, chunk[:data], repository: nil, plain: snippet.no_highlighting?)
- unless chunk == snippet_chunks.last
%a
= "..."
- else - else
.file-content.code .file-content.code
.nothing-here-block Empty file .nothing-here-block Empty file
---
title: Fix snippets search result spacing
merge_request:
author:
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment