From 99996b6bc7c13e7e7f871919942907b380d4b58c Mon Sep 17 00:00:00 2001 From: Robert Speicher Date: Tue, 2 May 2017 14:52:19 +0000 Subject: Merge branch 'bvl-security-9-1-markup-pipeline' (security-9-1) Render asciidoc & other markup using banzai in a pipeline See merge request !2098 --- app/helpers/markup_helper.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'app/helpers/markup_helper.rb') diff --git a/app/helpers/markup_helper.rb b/app/helpers/markup_helper.rb index b241a14740b..b636233c426 100644 --- a/app/helpers/markup_helper.rb +++ b/app/helpers/markup_helper.rb @@ -116,13 +116,13 @@ module MarkupHelper if gitlab_markdown?(file_name) markdown_unsafe(text, context) elsif asciidoc?(file_name) - asciidoc_unsafe(text) + asciidoc_unsafe(text, context) elsif plain?(file_name) content_tag :pre, class: 'plain-readme' do text end else - other_markup_unsafe(file_name, text) + other_markup_unsafe(file_name, text, context) end rescue RuntimeError simple_format(text) @@ -217,12 +217,12 @@ module MarkupHelper Banzai.render(text, context) end - def asciidoc_unsafe(text) - Gitlab::Asciidoc.render(text) + def asciidoc_unsafe(text, context = {}) + Gitlab::Asciidoc.render(text, context) end - def other_markup_unsafe(file_name, text) - Gitlab::OtherMarkup.render(file_name, text) + def other_markup_unsafe(file_name, text, context = {}) + Gitlab::OtherMarkup.render(file_name, text, context) end def prepare_for_rendering(html, context = {}) -- cgit v1.2.1