Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Eastwood <contact@ericeastwood.com>2018-04-04 20:11:55 +0300
committerEric Eastwood <contact@ericeastwood.com>2018-04-04 20:29:03 +0300
commita6c7d8050eb6eeb0373f69a3f99c7f7b64f77e07 (patch)
treef652425e0aaf3c20d2788e21683492528fd5bb58 /lib/gitlab/utils.rb
parent1be9f587351639a359416e915a25faf7280b65e9 (diff)
Add custom additonal email text to all emails
Fix https://gitlab.com/gitlab-org/gitlab-ee/issues/4474 Conflicts: db/schema.rb ee/app/controllers/ee/admin/application_settings_controller.rb ee/app/helpers/ee/application_settings_helper.rb ee/app/models/ee/application_setting.rb ee/app/models/license.rb ee/app/views/layouts/service_desk.html.haml ee/app/views/notify/approved_merge_request_email.html.haml ee/app/views/notify/service_desk_new_note_email.text.erb ee/app/views/notify/service_desk_thank_you_email.text.erb ee/app/views/notify/unapproved_merge_request_email.html.haml ee/lib/ee/api/entities.rb ee/spec/controllers/admin/application_settings_controller_spec.rb ee/spec/models/application_setting_spec.rb ee/spec/requests/api/settings_spec.rb lib/api/settings.rb spec/mailers/previews/notify_preview.rb
Diffstat (limited to 'lib/gitlab/utils.rb')
-rw-r--r--lib/gitlab/utils.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/gitlab/utils.rb b/lib/gitlab/utils.rb
index dc9391f32cf..b0a492eaa58 100644
--- a/lib/gitlab/utils.rb
+++ b/lib/gitlab/utils.rb
@@ -27,6 +27,11 @@ module Gitlab
.gsub(/(\A-+|-+\z)/, '')
end
+ # Converts newlines into HTML line break elements
+ def nlbr(str)
+ ActionView::Base.full_sanitizer.sanitize(str, tags: []).gsub(/\r?\n/, '<br>').html_safe
+ end
+
def remove_line_breaks(str)
str.gsub(/\r?\n/, '')
end