diff options
Diffstat (limited to 'lib/gitlab/markdown.rb')
-rw-r--r-- | lib/gitlab/markdown.rb | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/lib/gitlab/markdown.rb b/lib/gitlab/markdown.rb index cc68416d5fc..4b45f239ce5 100644 --- a/lib/gitlab/markdown.rb +++ b/lib/gitlab/markdown.rb @@ -24,10 +24,10 @@ module Gitlab # Public: Parse the provided text with GitLab-Flavored Markdown # # text - the source text - # project - the project + # options - options # html_options - extra options for the reference links as given to link_to - def gfm(text, project = @project, html_options = {}) - gfm_with_options(text, {}, project, html_options) + def gfm(text, options = {}, html_options = {}) + gfm_with_options(text, options, html_options) end # Public: Parse the provided text with GitLab-Flavored Markdown @@ -38,7 +38,7 @@ module Gitlab # :reference_only_path - Use relative path for reference links # project - the project # html_options - extra options for the reference links as given to link_to - def gfm_with_options(text, options = {}, project = @project, html_options = {}) + def gfm_with_options(text, options = {}, html_options = {}) return text if text.nil? # Duplicate the string so we don't alter the original, then call to_str @@ -48,7 +48,9 @@ module Gitlab options.reverse_merge!( xhtml: false, - reference_only_path: true + reference_only_path: true, + project: @project, + current_user: current_user ) pipeline = HTML::Pipeline.new(filters) @@ -62,9 +64,9 @@ module Gitlab no_header_anchors: options[:no_header_anchors], # ReferenceFilter - current_user: current_user, + current_user: options[:current_user], only_path: options[:reference_only_path], - project: project, + project: options[:project], reference_class: html_options[:class], # RelativeLinkFilter |