diff options
author | Robert Speicher <robert@gitlab.com> | 2017-05-02 17:52:19 +0300 |
---|---|---|
committer | Bob Van Landuyt <bob@gitlab.com> | 2017-05-10 17:44:20 +0300 |
commit | 99996b6bc7c13e7e7f871919942907b380d4b58c (patch) | |
tree | c87b232ade284781ae96d2819636c639d584972b /lib/gitlab/asciidoc.rb | |
parent | 9b03ed0a182c9ad96957085826cc85f8f229569c (diff) |
Merge branch 'bvl-security-9-1-markup-pipeline'
(security-9-1) Render asciidoc & other markup using banzai in a pipeline
See merge request !2098
Diffstat (limited to 'lib/gitlab/asciidoc.rb')
-rw-r--r-- | lib/gitlab/asciidoc.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/gitlab/asciidoc.rb b/lib/gitlab/asciidoc.rb index fba80c7132e..96d38f6daa0 100644 --- a/lib/gitlab/asciidoc.rb +++ b/lib/gitlab/asciidoc.rb @@ -15,17 +15,17 @@ module Gitlab # # input - the source text in Asciidoc format # - def self.render(input) + def self.render(input, context) asciidoc_opts = { safe: :secure, backend: :gitlab_html5, attributes: DEFAULT_ADOC_ATTRS } + context[:pipeline] = :markup + plantuml_setup html = ::Asciidoctor.convert(input, asciidoc_opts) - - filter = Banzai::Filter::SanitizationFilter.new(html) - html = filter.call.to_s + html = Banzai.render(html, context) html.html_safe end |