Commit c0126681 authored by Rémy Coutable's avatar Rémy Coutable

Fix an issue with wiki in search results when using ES

parent 9b80d894
......@@ -861,6 +861,8 @@ class Repository
def parse_search_result_from_elastic(result)
ref = result["_source"]["blob"]["commit_sha"]
filename = result["_source"]["blob"]["path"]
extname = File.extname(filename)
basename = filename.sub(/#{extname}$/, '')
content = result["_source"]["blob"]["content"]
total_lines = content.lines.size
......@@ -890,6 +892,7 @@ class Repository
OpenStruct.new(
filename: filename,
basename: basename,
ref: ref,
startline: from + 1,
data: data.join
......
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