Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
907860ed
Commit
907860ed
authored
Aug 12, 2015
by
Robert Speicher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove the `gfm_with_options` helper
It was redundant because `gfm` also took options.
parent
7d1c0679
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
14 deletions
+4
-14
lib/gitlab/markdown.rb
lib/gitlab/markdown.rb
+1
-11
lib/redcarpet/render/gitlab_html.rb
lib/redcarpet/render/gitlab_html.rb
+1
-1
spec/features/markdown_spec.rb
spec/features/markdown_spec.rb
+2
-2
No files found.
lib/gitlab/markdown.rb
View file @
907860ed
...
@@ -22,24 +22,14 @@ module Gitlab
...
@@ -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
...
...
lib/redcarpet/render/gitlab_html.rb
View file @
907860ed
...
@@ -41,6 +41,6 @@ class Redcarpet::Render::GitlabHTML < Redcarpet::Render::HTML
...
@@ -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
spec/features/markdown_spec.rb
View file @
907860ed
...
@@ -15,7 +15,7 @@ require 'erb'
...
@@ -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
...
@@ -179,7 +179,7 @@ describe 'GitLab Markdown', feature: true do
...
@@ -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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment