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
Kazuhiko Shiozaki
gitlab-ce
Commits
0093554a
Commit
0093554a
authored
Aug 26, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add test and docs for markdown tables
parent
3cc26654
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
1 deletion
+31
-1
doc/markdown/markdown.md
doc/markdown/markdown.md
+22
-1
spec/helpers/gitlab_markdown_helper_spec.rb
spec/helpers/gitlab_markdown_helper_spec.rb
+9
-0
No files found.
doc/markdown/markdown.md
View file @
0093554a
...
...
@@ -27,8 +27,9 @@ Table of Contents
[
Inline HTML
](
#toc_25
)
[
Horizontal Rule
](
#toc_26
)
[
Line Breaks
](
#toc_27
)
[
Tables
](
#toc_28
)
[References](#toc_2
8
)
[References](#toc_2
9
)
---------------------
----------------------------------------------
...
...
@@ -440,6 +441,26 @@ This line is separated from the one above by two newlines, so it will be a *sepa
This line is also begins a separate paragraph, but...
This line is only separated by a single newline, so it's a separate line in the *same paragraph*.
## Tables
Tables aren't part of the core Markdown spec, but they are part of GFM and Markdown Here supports them.
```
| header 1 | header 2 |
| -------- | -------- |
| cell 1 | cell 2 |
| cell 3 | cell 4 |
```
Code above produces next output:
| header 1 | header 2 |
| -------- | -------- |
| cell 1 | cell 2 |
| cell 3 | cell 4 |
------------
<a name="references"/>
...
...
spec/helpers/gitlab_markdown_helper_spec.rb
View file @
0093554a
...
...
@@ -366,6 +366,15 @@ describe GitlabMarkdownHelper do
markdown
(
actual
).
should
match
(
%r{Apply <em><a.+>!
#{
merge_request
.
iid
}
</a></em>}
)
end
it
"should handle tables"
do
actual
=
%Q{| header 1 | header 2 |
| -------- | -------- |
| cell 1 | cell 2 |
| cell 3 | cell 4 |}
markdown
(
actual
).
should
match
(
/\A<table/
)
end
it
"should leave code blocks untouched"
do
helper
.
stub
(
:user_color_scheme_class
).
and_return
(
:white
)
...
...
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