Permalink
Browse files

Fix 10.x sections showing up in 1.x section

* The eachSection regex was being allowing more sections to qualify
  than it should have.
* For example, when rootNumber is 1, sections labeled 10.* and 10
  were also matching, thus having all the sections for 10 repeated
  under section 1.
* This update will have it now match either '1', '1.', or '1.*'

Test suite still passed and sections now show up correctly.
  • Loading branch information...
1 parent af335c1 commit 67d04c82aa878ba34df4ccffc5f8df4161d2f8ba Michael Scheibe & Tamara Chu committed Mar 5, 2013
Showing with 1 addition and 1 deletion.
  1. +1 −1 bin/kss-node
View
@@ -353,7 +353,7 @@ handlebars.registerHelper('eachSection', function(query) {
i, l, buffer = "";
if (!query.match(/x|\*/g)) {
- query = new RegExp(query + ".*");
+ query = new RegExp('^' + query + '$|^' + query + "\\..*");
}
sections = styleguide.section(query);
if (!sections) return '';

0 comments on commit 67d04c8

Please sign in to comment.