mirror of
https://github.com/less/less.js.git
synced 2026-05-01 03:00:22 -04:00
Test for escaped paths
This commit is contained in:
@@ -1,43 +1,43 @@
|
||||
@charset "UTF-8";
|
||||
/* line 3, {pathimport}test.less */
|
||||
@media -sass-debug-info{filename{font-family:"{pathimport}test.less";}line{font-family:"3";}}
|
||||
@media -sass-debug-info{filename{font-family:file\:\/\/{pathimportesc}test\.less}line{font-family:\000033}}
|
||||
/* @charset "ISO-8859-1"; */
|
||||
/* line 23, {pathimport}test.less */
|
||||
@media -sass-debug-info{filename{font-family:"{pathimport}test.less";}line{font-family:"23";}}
|
||||
@media -sass-debug-info{filename{font-family:file\:\/\/{pathimportesc}test\.less}line{font-family:\0000323}}
|
||||
.tst3 {
|
||||
color: grey;
|
||||
}
|
||||
/* line 15, {path}linenumbers.less */
|
||||
@media -sass-debug-info{filename{font-family:"{path}linenumbers.less";}line{font-family:"15";}}
|
||||
@media -sass-debug-info{filename{font-family:file\:\/\/{pathesc}linenumbers\.less}line{font-family:\0000315}}
|
||||
.test1 {
|
||||
color: black;
|
||||
}
|
||||
/* line 6, {path}linenumbers.less */
|
||||
@media -sass-debug-info{filename{font-family:"{path}linenumbers.less";}line{font-family:"6";}}
|
||||
@media -sass-debug-info{filename{font-family:file\:\/\/{pathesc}linenumbers\.less}line{font-family:\000036}}
|
||||
.test2 {
|
||||
color: red;
|
||||
}
|
||||
@media all {
|
||||
/* line 5, {pathimport}test.less */
|
||||
@media -sass-debug-info{filename{font-family:"{pathimport}test.less";}line{font-family:"5";}}
|
||||
@media -sass-debug-info{filename{font-family:file\:\/\/{pathimportesc}test\.less}line{font-family:\000035}}
|
||||
.tst {
|
||||
color: black;
|
||||
}
|
||||
}
|
||||
@media all and screen {
|
||||
/* line 7, {pathimport}test.less */
|
||||
@media -sass-debug-info{filename{font-family:"{pathimport}test.less";}line{font-family:"7";}}
|
||||
@media -sass-debug-info{filename{font-family:file\:\/\/{pathimportesc}test\.less}line{font-family:\000037}}
|
||||
.tst {
|
||||
color: red;
|
||||
}
|
||||
/* line 9, {pathimport}test.less */
|
||||
@media -sass-debug-info{filename{font-family:"{pathimport}test.less";}line{font-family:"9";}}
|
||||
@media -sass-debug-info{filename{font-family:file\:\/\/{pathimportesc}test\.less}line{font-family:\000039}}
|
||||
.tst .tst3 {
|
||||
color: white;
|
||||
}
|
||||
}
|
||||
/* line 18, {pathimport}test.less */
|
||||
@media -sass-debug-info{filename{font-family:"{pathimport}test.less";}line{font-family:"18";}}
|
||||
@media -sass-debug-info{filename{font-family:file\:\/\/{pathimportesc}test\.less}line{font-family:\0000318}}
|
||||
.tst2 {
|
||||
color: white;
|
||||
}
|
||||
|
||||
@@ -1,35 +1,35 @@
|
||||
@charset "UTF-8";
|
||||
@media -sass-debug-info{filename{font-family:"{pathimport}test.less";}line{font-family:"3";}}
|
||||
@media -sass-debug-info{filename{font-family:file\:\/\/{pathimportesc}test\.less}line{font-family:\000033}}
|
||||
/* @charset "ISO-8859-1"; */
|
||||
@media -sass-debug-info{filename{font-family:"{pathimport}test.less";}line{font-family:"23";}}
|
||||
@media -sass-debug-info{filename{font-family:file\:\/\/{pathimportesc}test\.less}line{font-family:\0000323}}
|
||||
.tst3 {
|
||||
color: grey;
|
||||
}
|
||||
@media -sass-debug-info{filename{font-family:"{path}linenumbers.less";}line{font-family:"15";}}
|
||||
@media -sass-debug-info{filename{font-family:file\:\/\/{pathesc}linenumbers\.less}line{font-family:\0000315}}
|
||||
.test1 {
|
||||
color: black;
|
||||
}
|
||||
@media -sass-debug-info{filename{font-family:"{path}linenumbers.less";}line{font-family:"6";}}
|
||||
@media -sass-debug-info{filename{font-family:file\:\/\/{pathesc}linenumbers\.less}line{font-family:\000036}}
|
||||
.test2 {
|
||||
color: red;
|
||||
}
|
||||
@media all {
|
||||
@media -sass-debug-info{filename{font-family:"{pathimport}test.less";}line{font-family:"5";}}
|
||||
@media -sass-debug-info{filename{font-family:file\:\/\/{pathimportesc}test\.less}line{font-family:\000035}}
|
||||
.tst {
|
||||
color: black;
|
||||
}
|
||||
}
|
||||
@media all and screen {
|
||||
@media -sass-debug-info{filename{font-family:"{pathimport}test.less";}line{font-family:"7";}}
|
||||
@media -sass-debug-info{filename{font-family:file\:\/\/{pathimportesc}test\.less}line{font-family:\000037}}
|
||||
.tst {
|
||||
color: red;
|
||||
}
|
||||
@media -sass-debug-info{filename{font-family:"{pathimport}test.less";}line{font-family:"9";}}
|
||||
@media -sass-debug-info{filename{font-family:file\:\/\/{pathimportesc}test\.less}line{font-family:\000039}}
|
||||
.tst .tst3 {
|
||||
color: white;
|
||||
}
|
||||
}
|
||||
@media -sass-debug-info{filename{font-family:"{pathimport}test.less";}line{font-family:"18";}}
|
||||
@media -sass-debug-info{filename{font-family:file\:\/\/{pathimportesc}test\.less}line{font-family:\0000318}}
|
||||
.tst2 {
|
||||
color: white;
|
||||
}
|
||||
|
||||
@@ -59,8 +59,13 @@ runTestSet({dumpLineNumbers: 'all'}, "debug/", null,
|
||||
function(name) { return name + '-all'; });
|
||||
|
||||
function globalReplacements(input, directory) {
|
||||
return input.replace(/\{path\}/g, path.join(process.cwd(), directory))
|
||||
.replace(/\{pathimport\}/g, path.join(process.cwd(), directory + "import/"))
|
||||
var p = path.join(process.cwd(), directory);
|
||||
var pesc = p.replace(/[.:\/]/g, '\\$&');
|
||||
|
||||
return input.replace(/\{path\}/g, p)
|
||||
.replace(/\{pathesc\}/g, pesc)
|
||||
.replace(/\{pathimport\}/g, p+"import/")
|
||||
.replace(/\{pathimportesc\}/g, pesc + "import\\/")
|
||||
.replace(/\r\n/g, '\n');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user