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
Tatuya Kamada
gitlab-ce
Commits
04bad825
Commit
04bad825
authored
Aug 08, 2012
by
randx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed markdown tests
parent
6171a4d8
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
18 deletions
+18
-18
app/helpers/application_helper.rb
app/helpers/application_helper.rb
+0
-15
app/helpers/gitlab_markdown_helper.rb
app/helpers/gitlab_markdown_helper.rb
+15
-0
spec/helpers/gitlab_flavored_markdown_spec.rb
spec/helpers/gitlab_flavored_markdown_spec.rb
+3
-3
No files found.
app/helpers/application_helper.rb
View file @
04bad825
...
...
@@ -42,21 +42,6 @@ module ApplicationHelper
grouped_options_for_select
(
options
,
@ref
||
@project
.
default_branch
)
end
def
markdown
(
text
)
@__renderer
||=
Redcarpet
::
Markdown
.
new
(
Redcarpet
::
Render
::
GitlabHTML
.
new
(
self
,
filter_html:
true
,
with_toc_data:
true
),
{
no_intra_emphasis:
true
,
tables:
true
,
fenced_code_blocks:
true
,
autolink:
true
,
strikethrough:
true
,
lax_html_blocks:
true
,
space_after_headers:
true
,
superscript:
true
})
@__renderer
.
render
(
text
).
html_safe
end
def
search_autocomplete_source
projects
=
current_user
.
projects
.
map
{
|
p
|
{
:label
=>
p
.
name
,
:url
=>
project_path
(
p
)
}
}
default_nav
=
[
...
...
app/helpers/gitlab_markdown_helper.rb
View file @
04bad825
...
...
@@ -78,4 +78,19 @@ module GitlabMarkdownHelper
link_to
(
gfm_body
.
html_safe
,
url
,
html_options
)
end
def
markdown
(
text
)
@__renderer
||=
Redcarpet
::
Markdown
.
new
(
Redcarpet
::
Render
::
GitlabHTML
.
new
(
self
,
filter_html:
true
,
with_toc_data:
true
),
{
no_intra_emphasis:
true
,
tables:
true
,
fenced_code_blocks:
true
,
autolink:
true
,
strikethrough:
true
,
lax_html_blocks:
true
,
space_after_headers:
true
,
superscript:
true
})
@__renderer
.
render
(
text
).
html_safe
end
end
spec/helpers/gitlab_flavored_markdown_spec.rb
View file @
04bad825
require
"spec_helper"
describe
Applicatio
nHelper
do
describe
GitlabMarkdow
nHelper
do
before
do
@project
=
Project
.
find_by_path
(
"gitlabhq"
)
||
Factory
(
:project
)
@commit
=
@project
.
repo
.
commits
.
first
.
parents
.
first
...
...
@@ -10,10 +10,10 @@ describe ApplicationHelper do
end
describe
"#gfm"
do
it
"should r
aiase an error
if @project is not set"
do
it
"should r
eturn text
if @project is not set"
do
@project
=
nil
expect
{
gfm
(
"foo"
)
}.
to
raise_error
gfm
(
"foo"
).
should
==
"foo"
end
describe
"referencing a commit"
do
...
...
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