Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorGitLab Release Tools Bot <robert+release-tools@gitlab.com>2019-10-24 21:53:28 +0300
committerGitLab Release Tools Bot <robert+release-tools@gitlab.com>2019-10-24 21:53:28 +0300
commita2c31462f7fc013f41e7ca914a0b96869aa42c73 (patch)
treea024c4d951af465dc997f9f43ba6c137c22f7d0c /app
parent6df4db1f8df1240711d84586a7b7a9867ca3b57b (diff)
parentbc534868ec856410ca2664cd7fc9c7f89a48a277 (diff)
Merge branch 'security-wiki-rdoc-content-12-4-ce' into '12-4-stable'
Pass all wiki markup formats through our Banzai pipeline filters See merge request gitlab/gitlabhq!3485
Diffstat (limited to 'app')
-rw-r--r--app/helpers/markup_helper.rb10
-rw-r--r--app/models/wiki_page.rb6
2 files changed, 7 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
diff --git a/app/models/wiki_page.rb b/app/models/wiki_page.rb
index 1fa29e5b933..68241d2bd95 100644
--- a/app/models/wiki_page.rb
+++ b/app/models/wiki_page.rb
@@ -134,6 +134,12 @@ class WikiPage
@version ||= @page.version
end
+ def path
+ return unless persisted?
+
+ @path ||= @page.path
+ end
+
def versions(options = {})
return [] unless persisted?