Skip to content

Commit

Permalink
Use constants to reference capture subgroups.
Browse files Browse the repository at this point in the history
  • Loading branch information
gnab committed Jun 11, 2014
1 parent 73f21e7 commit 745c288
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/remark/lexer.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ var CODE = 1,
CONTENT = 2,
FENCES = 3,
DEF = 4,
DEF_HREF = 5,
DEF_TITLE = 6,
SEPARATOR = 7,
NOTES_SEPARATOR = 8;

Expand Down Expand Up @@ -63,9 +65,9 @@ function lex (src, regex, tokens) {
else if (cap[DEF]) {
tokens.push({
type: 'def',
id: cap[4],
href: cap[5],
title: cap[6]
id: cap[DEF],
href: cap[DEF_HREF],
title: cap[DEF_TITLE]
});
}
else if (cap[SEPARATOR]) {
Expand Down

0 comments on commit 745c288

Please sign in to comment.