|
19 | 19 | import java.io.IOException; |
20 | 20 | import java.io.InputStream; |
21 | 21 | import java.io.InputStreamReader; |
22 | | -import java.io.OutputStreamWriter; |
23 | 22 | import java.io.PrintStream; |
24 | | -import java.io.PrintWriter; |
25 | 23 | import java.io.SequenceInputStream; |
26 | 24 | import java.net.URL; |
27 | 25 | import java.util.ArrayList; |
28 | | -import java.util.Arrays; |
29 | 26 | import java.util.Collections; |
30 | 27 | import java.util.List; |
31 | 28 |
|
32 | 29 | import org.apache.commons.io.FileUtils; |
33 | | -import org.apache.commons.lang3.StringUtils; |
34 | 30 | import org.lesscss.logging.LessLogger; |
35 | 31 | import org.lesscss.logging.LessLoggerFactory; |
36 | 32 | import org.mozilla.javascript.Context; |
37 | 33 | import org.mozilla.javascript.Function; |
38 | 34 | import org.mozilla.javascript.JavaScriptException; |
39 | | -import org.mozilla.javascript.Script; |
40 | 35 | import org.mozilla.javascript.Scriptable; |
41 | 36 | import org.mozilla.javascript.ScriptableObject; |
42 | 37 | import org.mozilla.javascript.tools.shell.Global; |
@@ -332,7 +327,7 @@ public String compile(String input, String name) throws LessException { |
332 | 327 | tempFile = File.createTempFile("tmp", "less.tmp"); |
333 | 328 | FileUtils.writeStringToFile(tempFile, input, this.encoding); |
334 | 329 |
|
335 | | - return compile( tempFile, "<inline>"); |
| 330 | + return compile( tempFile, name); |
336 | 331 | } catch (IOException e) { |
337 | 332 | throw new LessException(e); |
338 | 333 |
|
@@ -391,7 +386,7 @@ public synchronized String compile(File input, String name) throws LessException |
391 | 386 | logger.debug("Finished compilation of LESS source in %,d ms.", System.currentTimeMillis() - start ); |
392 | 387 | } |
393 | 388 |
|
394 | | - return StringUtils.isNotBlank(this.encoding) ? out.toString(encoding) : out.toString(); |
| 389 | + return this.encoding != null && !this.encoding.equals("") ? out.toString(encoding) : out.toString(); |
395 | 390 | } |
396 | 391 | catch (Exception e) { |
397 | 392 | if (e instanceof JavaScriptException) { |
|
0 commit comments