Skip to content

Commit

Permalink
Count relevance of a mode upon ending instead of starting.
Browse files Browse the repository at this point in the history
  • Loading branch information
isagalaev committed Apr 3, 2013
1 parent ee56e0b commit bfa3be3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/highlight.js
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,6 @@ function() {
mode_buffer = lexem;
}
top = Object.create(mode, {parent: {value: top}});
relevance += mode.relevance;
}

function processLexem(buffer, lexem) {
Expand Down Expand Up @@ -344,6 +343,7 @@ function() {
if (top.className) {
result += '</span>';
}
relevance += top.relevance;
top = top.parent;
} while (top != end_mode.parent);
if (origin.excludeEnd) {
Expand Down

0 comments on commit bfa3be3

Please sign in to comment.