diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-12-17 11:59:07 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-12-17 11:59:07 +0000 |
commit | 8b573c94895dc0ac0e1d9d59cf3e8745e8b539ca (patch) | |
tree | 544930fb309b30317ae9797a9683768705d664c4 /app/helpers/markup_helper.rb | |
parent | 4b1de649d0168371549608993deac953eb692019 (diff) | |
download | gitlab-ce-8b573c94895dc0ac0e1d9d59cf3e8745e8b539ca.tar.gz |
Add latest changes from gitlab-org/gitlab@13-7-stable-eev13.7.0-rc42
Diffstat (limited to 'app/helpers/markup_helper.rb')
-rw-r--r-- | app/helpers/markup_helper.rb | 27 |
1 files changed, 17 insertions, 10 deletions
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') |