Skip to content

Commit 49b1556

Browse files
committed
ignore double escape characters. fix #82
1 parent 292fb1b commit 49b1556

File tree

4 files changed

+7
-2
lines changed

4 files changed

+7
-2
lines changed

src/com/inet/lib/less/LessLookAheadReader.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ int nextBlockMarker() throws LessException {
204204
if( ch == ch2 && !isSlash ) {
205205
break;
206206
}
207-
isSlash = ch2 == '\\';
207+
isSlash = ch2 == '\\' && !isSlash;
208208
}
209209
break;
210210
case '\\':

src/com/inet/lib/less/LessParser.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1092,7 +1092,7 @@ private void readQuote( char quote, StringBuilder builder ) {
10921092
if( ch == quote && !isBackslash ) {
10931093
return;
10941094
}
1095-
isBackslash = ch == '\\';
1095+
isBackslash = ch == '\\' && !isBackslash;
10961096
}
10971097
}
10981098

test/com/inet/lib/less/samples/less_org_tests/less/strings.css

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
#strings {
2+
doubleEscape: "\\";
3+
doubleEscapeVar: "\\";
24
background-image: url("http://son-of-a-banana.com");
35
quotes: "~" "~";
46
content: "#*%:&^,)!.(~*})";

test/com/inet/lib/less/samples/less_org_tests/less/strings.less

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1+
@doubleEscape: "\\";
12
#strings {
3+
doubleEscape: "\\";
4+
doubleEscapeVar: @doubleEscape;
25
background-image: url("http://son-of-a-banana.com");
36
quotes: "~" "~";
47
content: "#*%:&^,)!.(~*})";

0 commit comments

Comments
 (0)