From 8b573c94895dc0ac0e1d9d59cf3e8745e8b539ca Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Thu, 17 Dec 2020 11:59:07 +0000 Subject: Add latest changes from gitlab-org/gitlab@13-7-stable-ee --- app/helpers/markup_helper.rb | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) (limited to 'app/helpers/markup_helper.rb') diff --git a/app/helpers/markup_helper.rb b/app/helpers/markup_helper.rb index ed8931fe0f2..25d56ffca2c 100644 --- a/app/helpers/markup_helper.rb +++ b/app/helpers/markup_helper.rb @@ -126,16 +126,7 @@ module MarkupHelper text = wiki_page.content return '' unless text.present? - context.merge!( - pipeline: :wiki, - project: @project, - wiki: @wiki, - repository: @wiki.repository, - page_slug: wiki_page.slug, - issuable_state_filter_enabled: true - ) - - html = markup_unsafe(wiki_page.path, text, context) + html = markup_unsafe(wiki_page.path, text, render_wiki_content_context(@wiki, wiki_page, context)) prepare_for_rendering(html, context) end @@ -182,6 +173,20 @@ module MarkupHelper private + def render_wiki_content_context(wiki, wiki_page, context) + context.merge( + pipeline: :wiki, + wiki: wiki, + repository: wiki.repository, + page_slug: wiki_page.slug, + issuable_state_filter_enabled: true + ).merge(render_wiki_content_context_container(wiki)) + end + + def render_wiki_content_context_container(wiki) + { project: wiki.container } + end + # Return +text+, truncated to +max_chars+ characters, excluding any HTML # tags. def truncate_visible(text, max_chars) @@ -311,3 +316,5 @@ module MarkupHelper extend self end + +MarkupHelper.prepend_if_ee('EE::MarkupHelper') -- cgit v1.2.1