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
diff options
context:
space:
mode:
authorBen Boeckel <ben.boeckel@kitware.com>2016-02-01 19:07:59 +0300
committerRémy Coutable <remy@rymai.me>2016-02-12 19:20:59 +0300
commite919b5a4e9dd5e09628daf28b7b96424b764863b (patch)
tree0557a7a903b32becc1772f5bcf22e993d648b163 /lib/gitlab/other_markup.rb
parent0d866d89ec26bf05f2777ac5e5cb3f23f90f0a8c (diff)
Fix relative links in other markup formats
- Apply the RelativeLinkFilter filter to other formats, e.g., reStructuredText so links from the Files view or the Project view work - Remove the AsciidocPipeline pipeline Fixes #3533.
Diffstat (limited to 'lib/gitlab/other_markup.rb')
-rw-r--r--lib/gitlab/other_markup.rb24
1 files changed, 24 insertions, 0 deletions
diff --git a/lib/gitlab/other_markup.rb b/lib/gitlab/other_markup.rb
new file mode 100644
index 00000000000..746ec283330
--- /dev/null
+++ b/lib/gitlab/other_markup.rb
@@ -0,0 +1,24 @@
+module Gitlab
+ # Parser/renderer for markups without other special support code.
+ module OtherMarkup
+
+ # Public: Converts the provided markup into HTML.
+ #
+ # input - the source text in a markup format
+ # context - a Hash with the template context:
+ # :commit
+ # :project
+ # :project_wiki
+ # :requested_path
+ # :ref
+ #
+ def self.render(file_name, input, context)
+ html = GitHub::Markup.render(file_name, input).
+ force_encoding(input.encoding)
+
+ html = Banzai.post_process(html, context)
+
+ html.html_safe
+ end
+ end
+end