Skip to content

Highlighting search results is broken

Summary

Code search results are not highlighted

Steps to reproduce

https://gitlab.com/search?utf8=%E2%9C%93&search=SearchResult&group_id=&project_id=13083&search_code=true&repository_ref=master

What is the current bug behavior?

Code is highlighted as plain-text (i.e., not at all)

What is the expected correct behavior?

Code should be highlighted according to the language that it is

Relevant logs and/or screenshots

Screen_Shot_2017-04-03_at_18.08.12

Possible fixes

I've tracked this down to a mismatch between OpenStruct instances returned here and the expectations for blobs here

One expects a path, the other returns a filename.

There's a similar issue with elasticsearch results: https://gitlab.com/gitlab-org/gitlab-ee/issues/1567

i'm going to introduce a class for us to use instead of an OpenStruct, so in the future this will blow a NoMethodError if expectations change.