summaryrefslogtreecommitdiff
path: root/app/helpers/markup_helper.rb
diff options
context:
space:
mode:
authorLuke Duncalfe <lduncalfe@eml.cc>2019-10-03 17:01:57 +1300
committerLuke Duncalfe <lduncalfe@eml.cc>2019-10-23 11:42:37 +1300
commit49a78d419d2379b06fd917173717a9fe8174697a (patch)
tree80b79a5457193c82696c076437b5d36e881ff214 /app/helpers/markup_helper.rb
parentd5e0416021aa6de53b89f9d415f368226d9326e5 (diff)
downloadgitlab-ce-49a78d419d2379b06fd917173717a9fe8174697a.tar.gz
Pass all wiki markup formats through pipelines
Previously, when the wiki page format was anything other than `markdown` or `asciidoc` the formatted content would be returned though a Gitaly call. Gitaly in turn would delegate formatting to the gitlab-gollum-lib gem, which in turn would delegate that to various gems (like RDoc for `rdoc`) and then apply some very liberal sanitization. It was too liberal! This change brings our wiki content formatting in line with how we format other markdown at GitLab, so we have a SSOT for sanitization. https://gitlab.com/gitlab-org/gitlab/issues/30540
Diffstat (limited to 'app/helpers/markup_helper.rb')
-rw-r--r--app/helpers/markup_helper.rb10
1 files changed, 1 insertions, 9 deletions
diff --git a/app/helpers/markup_helper.rb b/app/helpers/markup_helper.rb
index d76a0f3a3b8..e2524938e10 100644
--- a/app/helpers/markup_helper.rb
+++ b/app/helpers/markup_helper.rb
@@ -133,15 +133,7 @@ module MarkupHelper
issuable_state_filter_enabled: true
)
- html =
- case wiki_page.format
- when :markdown
- markdown_unsafe(text, context)
- when :asciidoc
- asciidoc_unsafe(text)
- else
- wiki_page.formatted_content.html_safe
- end
+ html = markup_unsafe(wiki_page.path, text, context)
prepare_for_rendering(html, context)
end