Commit d6eccce8 authored by Changzheng Liu's avatar Changzheng Liu Committed by Dylan Griffith

Remove markdown from comment search result

parent f205ce09
......@@ -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