Skip to content
Snippets Groups Projects
Commit 907860ed authored by Robert Speicher's avatar Robert Speicher
Browse files

Remove the `gfm_with_options` helper

It was redundant because `gfm` also took options.
parent 7d1c0679
No related branches found
No related tags found
1 merge request!1152Remove the `gfm_with_options` helper
Pipeline #
Loading
@@ -22,24 +22,14 @@ module Gitlab
Loading
@@ -22,24 +22,14 @@ module Gitlab
autoload :TaskListFilter, 'gitlab/markdown/task_list_filter' autoload :TaskListFilter, 'gitlab/markdown/task_list_filter'
autoload :UserReferenceFilter, 'gitlab/markdown/user_reference_filter' autoload :UserReferenceFilter, 'gitlab/markdown/user_reference_filter'
   
# 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 # Public: Parse the provided text with GitLab-Flavored Markdown
# #
# text - the source text # text - the source text
# options - A Hash of options used to customize output (default: {}): # options - A Hash of options used to customize output (default: {}):
# :xhtml - output XHTML instead of HTML # :xhtml - output XHTML instead of HTML
# :reference_only_path - Use relative path for reference links # :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 # 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? return text if text.nil?
   
# Duplicate the string so we don't alter the original, then call to_str # Duplicate the string so we don't alter the original, then call to_str
Loading
Loading
Loading
@@ -41,6 +41,6 @@ class Redcarpet::Render::GitlabHTML < Redcarpet::Render::HTML
Loading
@@ -41,6 +41,6 @@ class Redcarpet::Render::GitlabHTML < Redcarpet::Render::HTML
end end
   
def postprocess(full_document) def postprocess(full_document)
h.gfm_with_options(full_document, @options) h.gfm(full_document, @options)
end end
end end
Loading
@@ -15,7 +15,7 @@ require 'erb'
Loading
@@ -15,7 +15,7 @@ require 'erb'
# -> `markdown` helper # -> `markdown` helper
# -> Redcarpet::Render::GitlabHTML converts Markdown to HTML # -> Redcarpet::Render::GitlabHTML converts Markdown to HTML
# -> Post-process HTML # -> Post-process HTML
# -> `gfm_with_options` helper # -> `gfm` helper
# -> HTML::Pipeline # -> HTML::Pipeline
# -> SanitizationFilter # -> SanitizationFilter
# -> Other filters, depending on pipeline # -> Other filters, depending on pipeline
Loading
@@ -179,7 +179,7 @@ describe 'GitLab Markdown', feature: true do
Loading
@@ -179,7 +179,7 @@ describe 'GitLab Markdown', feature: true do
before(:all) do before(:all) do
@feat = MarkdownFeature.new @feat = MarkdownFeature.new
   
# `gfm_with_options` depends on a `@project` variable # `gfm` helper depends on a `@project` variable
@project = @feat.project @project = @feat.project
   
@html = markdown(@feat.raw_markdown) @html = markdown(@feat.raw_markdown)
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment