diff options
author | Douwe Maan <douwe@gitlab.com> | 2015-08-17 23:42:29 +0000 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2015-08-17 23:42:29 +0000 |
commit | 262c6f11fee407350b8945501279a591d35ccb85 (patch) | |
tree | b2ddab6fd5e13f73f0c65e154e46d3d30d2f0e7b | |
parent | c9920c422d55680310cffcf34432d708de4bf207 (diff) | |
parent | 907860ed3d6f1a9865026b3028c48c69b1b591ee (diff) | |
download | gitlab-ce-262c6f11fee407350b8945501279a591d35ccb85.tar.gz |
Merge branch 'rs-remove-gfm_with_options' into 'master'
Remove the `gfm_with_options` helper
It was redundant because `gfm` also took options.
See merge request !1152
-rw-r--r-- | lib/gitlab/markdown.rb | 12 | ||||
-rw-r--r-- | lib/redcarpet/render/gitlab_html.rb | 2 | ||||
-rw-r--r-- | spec/features/markdown_spec.rb | 4 |
3 files changed, 4 insertions, 14 deletions
diff --git a/lib/gitlab/markdown.rb b/lib/gitlab/markdown.rb index 889decc9b48..9f6e19a09fd 100644 --- a/lib/gitlab/markdown.rb +++ b/lib/gitlab/markdown.rb @@ -25,21 +25,11 @@ module Gitlab # Public: Parse the provided text with GitLab-Flavored Markdown # # text - the source text - # options - options - # html_options - extra options for the reference links as given to link_to - def gfm(text, options = {}, html_options = {}) - gfm_with_options(text, options, html_options) - end - - # Public: Parse the provided text with GitLab-Flavored Markdown - # - # text - the source text # options - A Hash of options used to customize output (default: {}): # :xhtml - output XHTML instead of HTML # :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 = {}, html_options = {}) + def gfm(text, options = {}, html_options = {}) return text if text.nil? # Duplicate the string so we don't alter the original, then call to_str diff --git a/lib/redcarpet/render/gitlab_html.rb b/lib/redcarpet/render/gitlab_html.rb index 04440e4f68d..f57b56cbdf0 100644 --- a/lib/redcarpet/render/gitlab_html.rb +++ b/lib/redcarpet/render/gitlab_html.rb @@ -41,6 +41,6 @@ class Redcarpet::Render::GitlabHTML < Redcarpet::Render::HTML end def postprocess(full_document) - h.gfm_with_options(full_document, @options) + h.gfm(full_document, @options) end end diff --git a/spec/features/markdown_spec.rb b/spec/features/markdown_spec.rb index 859a62f740f..3da4dfc2b23 100644 --- a/spec/features/markdown_spec.rb +++ b/spec/features/markdown_spec.rb @@ -15,7 +15,7 @@ require 'erb' # -> `markdown` helper # -> Redcarpet::Render::GitlabHTML converts Markdown to HTML # -> Post-process HTML -# -> `gfm_with_options` helper +# -> `gfm` helper # -> HTML::Pipeline # -> SanitizationFilter # -> Other filters, depending on pipeline @@ -179,7 +179,7 @@ describe 'GitLab Markdown', feature: true do before(:all) do @feat = MarkdownFeature.new - # `gfm_with_options` depends on a `@project` variable + # `gfm` helper depends on a `@project` variable @project = @feat.project @html = markdown(@feat.raw_markdown) |