Commit f728eb52 authored by Dylan Griffith's avatar Dylan Griffith

Merge branch '292435_unescape_trucated_search_result' into 'master'

Remove markdown from comment search result

See merge request gitlab-org/gitlab!55255
parents 920b98ba d6eccce8
......@@ -27,4 +27,4 @@
.note-search-result
.term
= search_md_sanitize(note.note)
= simple_search_highlight_and_truncate(note.note, @search_term)
---
title: Remove markdown from comment search result
merge_request: 55255
author:
type: other
......@@ -28,6 +28,21 @@ RSpec.describe 'search/_results' do
expect(rendered).to have_content('Showing 1 - 2 of 3 issues for foo')
end
context 'when searching notes which contain quotes in markdown' do
let_it_be(:project) { create(:project) }
let_it_be(:issue) { create(:issue, project: project, title: '*') }
let_it_be(:note) { create(:discussion_note_on_issue, noteable: issue, project: issue.project, note: '```"helloworld"```') }
let(:scope) { 'notes' }
let(:search_objects) { Note.page(1).per(2) }
let(:term) { 'helloworld' }
it 'renders plain quotes' do
render
expect(rendered).to include('"<mark>helloworld</mark>"')
end
end
context 'when search results do not have a count' do
before do
@search_objects = @search_objects.without_count
......
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