File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -95,6 +95,10 @@ def assets_path(name)
9595 File . join ( "./assets" , SimpleCov ::Formatter ::HTMLFormatter ::VERSION , name )
9696 end
9797
98+ def to_id ( value )
99+ value . gsub ( /^[^a-zA-Z]+/ , "" ) . gsub ( /[^a-zA-Z0-9\- _]/ , "" )
100+ end
101+
98102 def asset_inline ( name )
99103 path = File . join ( @public_assets_dir , name )
100104
@@ -119,7 +123,6 @@ def formatted_source_file(source_file)
119123
120124 # Returns a table containing the given source files
121125 def formatted_file_list ( title , source_files )
122- title_id = title . gsub ( /^[^a-zA-Z]+/ , "" ) . gsub ( /[^a-zA-Z0-9\- _]/ , "" )
123126 template ( "file_list" ) . result ( binding )
124127 end
125128
Original file line number Diff line number Diff line change 1- < div class ="file_list_container " id ="<%= title_id %> ">
1+ < div class ="file_list_container " id ="<%= to_id ( title ) %> ">
22 < h2 >
33 < span class ="group_name "> <%= title %> </ span >
44 (< span class ="covered_percent ">
1313 )
1414 </ h2 >
1515
16- < a name ="<%= title_id %> "> </ a >
16+ < a name ="<%= to_id ( title ) %> "> </ a >
1717
1818 < div >
1919 < b > <%= source_files . length %> </ b > files in total.
You can’t perform that action at this time.
0 commit comments