Commit 713802fd authored by Saito's avatar Saito

add plain text support,keep markdown and plain text in readme

parent 3dc94ba8
...@@ -35,11 +35,14 @@ ...@@ -35,11 +35,14 @@
- contents.select{ |i| i.is_a?(Grit::Blob)}.each do |content| - contents.select{ |i| i.is_a?(Grit::Blob)}.each do |content|
= render :partial => "refs/tree_item", :locals => { :content => content } = render :partial => "refs/tree_item", :locals => { :content => content }
- if content = contents.select{ |c| c.is_a?(Grit::Blob) and c.name =~ /^readme\.(md|markdown)$/i }.first - if content = contents.select{ |c| c.is_a?(Grit::Blob) and c.name =~ /^readme/i }.first
#tree-readme-holder #tree-readme-holder
%h3= content.name %h3= content.name
.readme .readme
- if content.name =~ /\.(md|markdown)$/i
= markdown(encode content.data) = markdown(encode content.data)
- else
= simple_format(encode content.data)
:javascript :javascript
$(function(){ $(function(){
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment