Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Support windows full paths in imports. Fixes #177.

  • Loading branch information...
commit 75e058f2ceeefe88f857bb97180c889e824f654e 1 parent ce66cdf
@lukeapage lukeapage authored
View
2  src/dotless.Core/Importers/Importer.cs
@@ -63,7 +63,7 @@ public Importer(IFileReader fileReader, bool disableUrlReWriting, bool inlineCss
/// </summary>
private static bool IsProtocolUrl(string url)
{
- return Regex.IsMatch(url, @"^([a-zA-Z]+:)");
+ return Regex.IsMatch(url, @"^([a-zA-Z]{2,}:)");
}
/// <summary>
View
20 src/dotless.Test/Specs/ImportFixture.cs
@@ -20,6 +20,11 @@ private static Parser GetParser(bool isUrlRewritingDisabled, bool importAllFiles
@import ""import-test-b.less"";
@a: 20%;
";
+ imports[@"c:/absolute/file.less"] = @"
+.windowz .dos {
+ border: none;
+}
+";
imports["import/other-protocol-test.less"] = @"
.first {
background-image: url('http://some.com/file.gif');
@@ -180,6 +185,21 @@ public void OtherProtocolImportTest2()
Assert.AreEqual(0, dictionaryReader.GetFileContentsCalls.Count, "We should not ask the file reader if a protocol file exists");
}
+ [Test]
+ public void OtherProtocolImportTest3()
+ {
+ var input = @"
+@import url('c:/absolute/file.less');";
+ var expected = @"
+.windowz .dos {
+ border: none;
+}
+";
+ var parser = GetParser();
+
+ AssertLess(input, expected, parser);
+ }
+
[Test]
public void RelativeUrls()
{
Please sign in to comment.
Something went wrong with that request. Please try again.