Permalink
Browse files

Fix a bug where empty lines broke the generated JS.

  • Loading branch information...
1 parent e9d2b12 commit 291be8eb9605bdfafde11a52c377d82b8e5d9466 @creationix committed Apr 5, 2010
Showing with 9 additions and 1 deletion.
  1. +1 −1 lib/haml.js
  2. +6 −0 test/nanline.haml
  3. +2 −0 test/nanline.html
View
@@ -152,7 +152,7 @@ var Haml;
items.push(match[1] || match[2]);
pos += next;
}
- return items.join(" +\n");
+ return items.filter(function (part) { return part && part.length > 0}).join(" +\n");
}
// Used to find embedded code in interpolated strings.
View
@@ -0,0 +1,6 @@
+!!! 5
+%html
+ %head
+ %title atomix
+
+ %script(src='atomix_xlib.js')
View
@@ -0,0 +1,2 @@
+<!DOCTYPE html>
+<html><head><title>atomix<script src="atomix_xlib.js"></script></head></html>

0 comments on commit 291be8e

Please sign in to comment.