diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-04 12:08:20 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-04 12:08:20 +0300 |
commit | d80f3cd75e700b6e62910865bfd36734644ffa89 (patch) | |
tree | aa2fa2f2b4385854c13591bef8e74924ef661657 /app/helpers | |
parent | be81c1578d65f25edfde8aa550f190b8d3e6d976 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/helpers')
-rw-r--r-- | app/helpers/markup_helper.rb | 6 | ||||
-rw-r--r-- | app/helpers/suggest_pipeline_helper.rb | 9 |
2 files changed, 12 insertions, 3 deletions
diff --git a/app/helpers/markup_helper.rb b/app/helpers/markup_helper.rb index a0228c6bd94..4f66356c27e 100644 --- a/app/helpers/markup_helper.rb +++ b/app/helpers/markup_helper.rb @@ -79,7 +79,7 @@ module MarkupHelper md = markdown_field(object, attribute, options.merge(post_process: false)) return unless md.present? - tags = %w(a gl-emoji b pre code p span) + tags = %w(a gl-emoji b strong i em pre code p span) tags << 'img' if options[:allow_images] text = truncate_visible(md, max_chars || md.length) @@ -88,7 +88,7 @@ module MarkupHelper text, tags: tags, attributes: Rails::Html::WhiteListSanitizer.allowed_attributes + - %w(style data-src data-name data-unicode-version data-iid data-project-path data-mr-title) + %w(style data-src data-name data-unicode-version data-iid data-project-path data-mr-title data-html) ) # since <img> tags are stripped, this can leave empty <a> tags hanging around @@ -233,7 +233,7 @@ module MarkupHelper def strip_empty_link_tags(text) scrubber = Loofah::Scrubber.new do |node| - node.remove if node.name == 'a' && node.content.blank? + node.remove if node.name == 'a' && node.children.empty? end sanitize text, scrubber: scrubber diff --git a/app/helpers/suggest_pipeline_helper.rb b/app/helpers/suggest_pipeline_helper.rb new file mode 100644 index 00000000000..aa67f0ea770 --- /dev/null +++ b/app/helpers/suggest_pipeline_helper.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +module SuggestPipelineHelper + def should_suggest_gitlab_ci_yml? + Feature.enabled?(:suggest_pipeline) && + current_user && + params[:suggest_gitlab_ci_yml] == 'true' + end +end |