... | ... |
@@ -2,6 +2,7 @@ |
2 | 2 |
- add README.md support |
3 | 3 |
- add submodule support |
4 | 4 |
- add Smart HTTP and basic authentication support |
5 |
+ - add Markdown format in normal file |
|
5 | 6 |
1.2 |
6 | 7 |
- add blame page |
7 | 8 |
- add blanch import feature |
... | ... |
@@ -1,4 +1,6 @@ |
1 | 1 |
<% |
2 |
+ use Text::Markdown::Discount (); |
|
3 |
+ |
|
2 | 4 |
# API |
3 | 5 |
my $api = gitprep_api; |
4 | 6 |
|
... | ... |
@@ -75,7 +77,13 @@ |
75 | 77 |
</div> |
76 | 78 |
</div> |
77 | 79 |
</div> |
78 |
- % if ($mime_type =~ m#^image/#) { |
|
80 |
+ % if ($file =~ /\.md$/) { |
|
81 |
+ % my $readme = join "\n", @$lines; |
|
82 |
+ % my $readme_e = Text::Markdown::Discount::markdown($readme); |
|
83 |
+ <div class="markdown border-gray"> |
|
84 |
+ <%== $readme_e %> |
|
85 |
+ </div> |
|
86 |
+ % } elsif ($mime_type =~ m#^image/#) { |
|
79 | 87 |
<div style="background:#ddd;text-align:center;padding-top:30px;padding-bottom:30px;margin-bottom:30px"> |
80 | 88 |
<img type="<%= $mime_type %> |
81 | 89 |
% if (defined $file) { |
... | ... |
@@ -1,4 +1,6 @@ |
1 | 1 |
<% |
2 |
+ use Text::Markdown::Discount (); |
|
3 |
+ |
|
2 | 4 |
my $state; |
3 | 5 |
|
4 | 6 |
# API |
... | ... |
@@ -434,3 +434,10 @@ note 'blame'; |
434 | 434 |
# Lines |
435 | 435 |
$t->content_like(qr#http://foo1#); |
436 | 436 |
} |
437 |
+ |
|
438 |
+note 'Markdown normal file'; |
|
439 |
+{ |
|
440 |
+ # Page access |
|
441 |
+ $t->get_ok("/$user/$project/blob/12e44f2e4ecf55c5d3a307889829b47c05e216d3/dir/markdown.md"); |
|
442 |
+ $t->content_like(qr#<h1>Head</h1>#); |
|
443 |
+} |