Skip to content

Commit e47c309

Browse files
author
Simen Brekken
committed
Fix an issue with comments containing slashes.
1 parent b2d99a8 commit e47c309

File tree

3 files changed

+23
-1
lines changed

3 files changed

+23
-1
lines changed

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ module.exports = function(css){
7575
function comment() {
7676
if ('/' == css[0] && '*' == css[1]) {
7777
var i = 2;
78-
while ('*' != css[i] && '/' != css[i + 1]) ++i;
78+
while ('*' != css[i] || '/' != css[i + 1]) ++i;
7979
i += 2;
8080
css = css.slice(i);
8181
whitespace();

test/cases/comment.url.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/* http://foo.com/bar/baz.html */
2+
3+
foo { /*/*/
4+
bar: baz; /* http://foo.com/bar/baz.html */
5+
}

test/cases/comment.url.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"stylesheet": {
3+
"rules": [
4+
{
5+
"selectors": [
6+
"foo"
7+
],
8+
"declarations": [
9+
{
10+
"property": "bar",
11+
"value": "baz"
12+
}
13+
]
14+
}
15+
]
16+
}
17+
}

0 commit comments

Comments
 (0)