summaryrefslogtreecommitdiffstats
path: root/app/views/repositories/entry.rhtml
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2007-08-15 20:20:18 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2007-08-15 20:20:18 +0000
commit889d50089d4d98db83ba5617b526da50107be661 (patch)
treed9bed99952fddce716e6d7acf189603358bb2021 /app/views/repositories/entry.rhtml
parenta5849ee044837be589e9aae554cf99a394b9b9af (diff)
downloadredmine-889d50089d4d98db83ba5617b526da50107be661.tar.gz
redmine-889d50089d4d98db83ba5617b526da50107be661.zip
Added syntax highlightment for repository files (using CodeRay).
Supported languages: c, ruby, rhtml, yaml, html, xml. git-svn-id: http://redmine.rubyforge.org/svn/trunk@644 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/views/repositories/entry.rhtml')
-rw-r--r--app/views/repositories/entry.rhtml6
1 files changed, 3 insertions, 3 deletions
diff --git a/app/views/repositories/entry.rhtml b/app/views/repositories/entry.rhtml
index dfceac2ef..5ced710f5 100644
--- a/app/views/repositories/entry.rhtml
+++ b/app/views/repositories/entry.rhtml
@@ -1,6 +1,6 @@
<h2><%= render :partial => 'navigation', :locals => { :path => @path, :kind => 'file', :revision => @rev } %></h2>
-<table class="list">
+<table class="list CodeRay">
<thead>
<tr>
<th colspan="2" class="list-filename"><%= @path %></th>
@@ -8,10 +8,10 @@
</thead>
<tbody>
<% line_num = 1 %>
- <% @content.each_line do |line| %>
+ <% syntax_highlight(@path, @content).each_line do |line| %>
<tr>
<th class="line-num"><%= line_num %></th>
- <td class="line-code"><%= h(line).gsub(/\s/, '&nbsp;') %></td>
+ <td class="line-code"><pre><%= line %></pre></td>
</tr>
<% line_num += 1 %>
<% end %>