Skip to content
Snippets Groups Projects

BE: Allow customers to extend or reactivate their trial on gitlab.com [RUN ALL RSPEC] [RUN AS-IF-FOSS]

Merged Qingyu Zhao requested to merge 290278-allow-extend-or-reactivate-trial-on-gitlab-com into master
All threads resolved!
7 files
+ 24
19
Compare changes
  • Side-by-side
  • Inline
Files
7
+ 13
15
@@ -360,33 +360,31 @@ def search_history_storage_prefix
@@ -360,33 +360,31 @@ def search_history_storage_prefix
end
end
end
end
 
def search_md_sanitize(source)
 
search_sanitize(markdown(search_truncate(source)))
 
end
 
 
def simple_search_highlight_and_truncate(text, phrase, options = {})
 
highlight(search_sanitize(search_truncate(text)), phrase.split, options)
 
end
 
# Sanitize a HTML field for search display. Most tags are stripped out and the
# Sanitize a HTML field for search display. Most tags are stripped out and the
# maximum length is set to 200 characters.
# maximum length is set to 200 characters.
def search_md_sanitize(source)
def search_truncate(source)
source = Truncato.truncate(
Truncato.truncate(
source,
source,
count_tags: false,
count_tags: false,
count_tail: false,
count_tail: false,
 
filtered_tags: %w(img),
max_length: 200
max_length: 200
)
)
 
end
html = markdown(source)
def search_sanitize(html)
# Truncato's filtered_tags and filtered_attributes are not quite the same
# Truncato's filtered_tags and filtered_attributes are not quite the same
sanitize(html, tags: %w(a p ol ul li pre code))
sanitize(html, tags: %w(a p ol ul li pre code))
end
end
def simple_search_highlight_and_truncate(text, phrase, options = {})
text = Truncato.truncate(
text,
count_tags: false,
count_tail: false,
max_length: options.delete(:length) { 200 }
)
highlight(text, phrase.split, options)
end
# _search_highlight is used in EE override
# _search_highlight is used in EE override
def highlight_and_truncate_issuable(issuable, search_term, _search_highlight)
def highlight_and_truncate_issuable(issuable, search_term, _search_highlight)
return unless issuable.description.present?
return unless issuable.description.present?
Loading