We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a5d33d1 commit b60edbaCopy full SHA for b60edba
2 files changed
lib/nodes/inline-comment.js
@@ -1,6 +1,6 @@
1
module.exports = {
2
isInlineComment(token) {
3
- if (token[0] === 'word' && token[1] === '//') {
+ if (token[0] === 'word' && token[1].slice(0, 2) === '//') {
4
const first = token;
5
const bits = [];
6
let last;
test/parser/comments.test.js
@@ -15,6 +15,18 @@ test('inline comment', (t) => {
15
t.is(nodeToString(root), less);
16
});
17
18
+test('inline comment without leading space', (t) => {
19
+ const less = '//batman';
20
+ const root = parse(less);
21
+ const { first } = root;
22
+
23
+ t.truthy(root);
24
+ t.true(first instanceof Comment);
25
+ t.true(first.inline);
26
+ t.is(first.text, 'batman');
27
+ t.is(nodeToString(root), less);
28
+});
29
30
test('close empty', (t) => {
31
const less = '// \n//';
32
const root = parse(less);
0 commit comments