From 3483f514ed2f72cf6a42cacaa5beb1793af63a4a Mon Sep 17 00:00:00 2001 From: Tacnoman Cassino Date: Sat, 28 Apr 2018 18:14:14 -0300 Subject: [PATCH] Fix bug after close comment --- __tests__/__snapshots__/comment.js.snap | 28 +++++++++++++++++++++++++ src/tokenize.js | 2 +- 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/__tests__/__snapshots__/comment.js.snap b/__tests__/__snapshots__/comment.js.snap index 8f97288..5c01655 100644 --- a/__tests__/__snapshots__/comment.js.snap +++ b/__tests__/__snapshots__/comment.js.snap @@ -34,6 +34,13 @@ Array [ 1, 14, ], + Array [ + "newline", + " +", + 2, + 0, + ], ] `; @@ -175,6 +182,13 @@ Array [ 5, 3, ], + Array [ + "newline", + " +", + 6, + 0, + ], ] `; @@ -226,6 +240,13 @@ Array [ 3, 2, ], + Array [ + "newline", + " +", + 4, + 0, + ], ] `; @@ -271,5 +292,12 @@ Array [ 1, 16, ], + Array [ + "newline", + " +", + 2, + 0, + ], ] `; diff --git a/src/tokenize.js b/src/tokenize.js index 56feb2a..a074874 100644 --- a/src/tokenize.js +++ b/src/tokenize.js @@ -200,7 +200,7 @@ export default function tokenize(input, l, p) { if ( inComment && code === asterisk && css.charCodeAt(pos + 1) === slash ) { inComment = false; tokens.push(['endComment', '*/', line, pos + 1 - offset]); - pos += 2; + pos += 1; break; }