Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

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

Merged
merged 1 commit into from

2 participants

Michael Scheibe Hugh Kennedy
Michael Scheibe
  • The eachSection regex was 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.

Michael Scheibe & Tamara Chu Fix 10.x sections showing up in 1.x section
* The eachSection regex was 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.
fc48069
Hugh Kennedy hughsk merged commit b7d2e81 into from
Hugh Kennedy
Owner

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 5, 2013
  1. Fix 10.x sections showing up in 1.x section

    Michael Scheibe & Tamara Chu authored
    * The eachSection regex was 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.
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  bin/kss-node
2  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 '';
Something went wrong with that request. Please try again.