Commit 713802fdf317593f1201cf5dd4c34238ffccca0a
1 parent
3dc94ba8
Exists in
master
and in
4 other branches
add plain text support,keep markdown and plain text in readme
Showing
1 changed file
with
5 additions
and
2 deletions
Show diff stats
app/views/refs/_tree.html.haml
| ... | ... | @@ -35,11 +35,14 @@ |
| 35 | 35 | - contents.select{ |i| i.is_a?(Grit::Blob)}.each do |content| |
| 36 | 36 | = render :partial => "refs/tree_item", :locals => { :content => content } |
| 37 | 37 | |
| 38 | - - if content = contents.select{ |c| c.is_a?(Grit::Blob) and c.name =~ /^readme\.(md|markdown)$/i }.first | |
| 38 | + - if content = contents.select{ |c| c.is_a?(Grit::Blob) and c.name =~ /^readme/i }.first | |
| 39 | 39 | #tree-readme-holder |
| 40 | 40 | %h3= content.name |
| 41 | 41 | .readme |
| 42 | - = markdown(encode content.data) | |
| 42 | + - if content.name =~ /\.(md|markdown)$/i | |
| 43 | + = markdown(encode content.data) | |
| 44 | + - else | |
| 45 | + = simple_format(encode content.data) | |
| 43 | 46 | |
| 44 | 47 | :javascript |
| 45 | 48 | $(function(){ | ... | ... |