Skip to content

Commit

Permalink
Merge pull request #14 from ebeigarts/fix-group-ids
Browse files Browse the repository at this point in the history
Do not strip digits, hyphens and underscores in group name ids
  • Loading branch information
colszowka committed Oct 10, 2012
2 parents 6ee67b5 + 53b8a3f commit 0a1876a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions lib/simplecov-html.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ def formatted_source_file(source_file)

# Returns a table containing the given source files
def formatted_file_list(title, source_files)
title_id = title.gsub(/^[^a-zA-Z]+/, '').gsub(/[^a-zA-Z0-9\-\_]/, '')
template('file_list').result(binding)
end

Expand Down
4 changes: 2 additions & 2 deletions views/file_list.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="file_list_container" id="<%= title.gsub(/[^a-zA-Z]/, '') %>">
<div class="file_list_container" id="<%= title_id %>">
<h2>
<span class="group_name"><%= title %></span>
(<span class="covered_percent"><span class="<%= coverage_css_class(source_files.covered_percent) %>"><%= source_files.covered_percent.round(2) %>%</span></span>
Expand All @@ -9,7 +9,7 @@
</span>
</span> hits/line)
</h2>
<a name="<%= title.gsub(/[^a-zA-Z]/, '') %>"></a>
<a name="<%= title_id %>"></a>
<div>
<b><%= source_files.length %></b> files in total.
<b><%= source_files.lines_of_code %></b> relevant lines.
Expand Down

0 comments on commit 0a1876a

Please sign in to comment.