Skip to content

Commit

Permalink
fix: parsing comments
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-akait committed Apr 14, 2023
1 parent bfcce62 commit f1cf224
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions lib/css/walkCssTokens.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,7 @@ const consumeComments = (input, pos, callbacks) => {
input.charCodeAt(pos) === CC_SOLIDUS &&
input.charCodeAt(pos + 1) === CC_ASTERISK
) {
pos += 2;
if (pos === input.length) return pos;
pos += 1;
while (pos < input.length) {
if (
input.charCodeAt(pos) === CC_ASTERISK &&
Expand Down Expand Up @@ -648,11 +647,11 @@ module.exports = (input, callbacks) => {
// This section describes how to consume a token from a stream of code points. It will return a single token of any type.
let pos = 0;
while (pos < input.length) {
const cc = input.charCodeAt(pos);

// Consume comments.
pos = consumeComments(input, pos, callbacks);

const cc = input.charCodeAt(pos);

// Consume the next input code point.
if (cc < 0x80) {
pos = CHAR_MAP[cc](input, pos, callbacks);
Expand Down

0 comments on commit f1cf224

Please sign in to comment.