diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-09-23 06:09:30 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-09-23 06:09:30 +0300 |
commit | 8007620dc7216ff2b9e7dde0aa88e6f47fc433e7 (patch) | |
tree | 88022526af20aee894008f852f79b40f70eeec1a /app/helpers/search_helper.rb | |
parent | 9c1284626ff95f13a34756b1d201a87ed61f9837 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/helpers/search_helper.rb')
-rw-r--r-- | app/helpers/search_helper.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/app/helpers/search_helper.rb b/app/helpers/search_helper.rb index 35df97f917c..e4ab4fc7c9a 100644 --- a/app/helpers/search_helper.rb +++ b/app/helpers/search_helper.rb @@ -294,6 +294,11 @@ module SearchHelper sanitize(html, tags: %w(a p ol ul li pre code)) end + # _search_highlight is used in EE override + def highlight_and_truncate_issue(issue, search_term, _search_highlight) + simple_search_highlight_and_truncate(issue.description, search_term, highlighter: '<span class="gl-text-black-normal gl-font-weight-bold">\1</span>') + end + def simple_search_highlight_and_truncate(text, phrase, options = {}) truncate_length = options.delete(:length) { 200 } text = truncate(text, length: truncate_length) |