Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not strip digits, hyphens and underscores in group name ids #14

Merged
merged 1 commit into from
Oct 10, 2012
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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