Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
d6eccce8
Commit
d6eccce8
authored
Mar 23, 2021
by
Changzheng Liu
Committed by
Dylan Griffith
Mar 23, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove markdown from comment search result
parent
f205ce09
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
1 deletion
+21
-1
app/views/search/results/_note.html.haml
app/views/search/results/_note.html.haml
+1
-1
changelogs/unreleased/292435_unescape_trucated_search_result.yml
...ogs/unreleased/292435_unescape_trucated_search_result.yml
+5
-0
spec/views/search/_results.html.haml_spec.rb
spec/views/search/_results.html.haml_spec.rb
+15
-0
No files found.
app/views/search/results/_note.html.haml
View file @
d6eccce8
...
...
@@ -27,4 +27,4 @@
.note-search-result
.term
=
s
earch_md_sanitize
(
note
.
note
)
=
s
imple_search_highlight_and_truncate
(
note
.
note
,
@search_term
)
changelogs/unreleased/292435_unescape_trucated_search_result.yml
0 → 100644
View file @
d6eccce8
---
title
:
Remove markdown from comment search result
merge_request
:
55255
author
:
type
:
other
spec/views/search/_results.html.haml_spec.rb
View file @
d6eccce8
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment