Skip to content

Commit d7739e7

Browse files
committed
Fix nth formula parsing bug
1 parent cc083f2 commit d7739e7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/selector-grammar.ne

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,12 +142,12 @@ nth -> [+-]:? int:? [nN] ( _ [+-] _ int ):?
142142
{% (d) => {
143143
return {
144144
type: 'nthFormula',
145-
parsed: {a: parseInt((d[0] || '') + (d[1] || '1')), b: d[3] ? parseInt((d[3][1] || '') + d[3][3]) : 0},
145+
parsed: {a: parseInt((d[0] || '') + (collapse(d[1]) || '1'), 10), b: d[3] ? parseInt((d[3][1] || '') + collapse(d[3][3]), 10) : 0},
146146
raw: collapseRaw(d),
147147
};
148148
} %}
149149
| [+-]:? int
150-
{% (d) => { return {type: 'nthFormula', parsed: {a: 0, b: parseInt((d[0] || '') + d[1])}, raw: collapseRaw(d)} } %}
150+
{% (d) => { return {type: 'nthFormula', parsed: {a: 0, b: parseInt((d[0] || '') + collapse(d[1]), 10)}, raw: collapseRaw(d)} } %}
151151
| ( [oO] [dD] [dD] | [eE] [vV] [eE] [nN] )
152152
{% (d) => { return {type: 'nthKeyword', parsed: collapse(d).toLowerCase(), raw: collapseRaw(d)} } %}
153153
hex -> [0-9a-fA-F]

0 commit comments

Comments
 (0)