diff --git a/examples/two_sections.html b/examples/two_sections.html new file mode 100644 index 0000000..cc54add --- /dev/null +++ b/examples/two_sections.html @@ -0,0 +1,7 @@ +{{#show_following}} + +{{/show_following}} +{{#show_following}} + +{{/show_following}} + diff --git a/examples/two_sections.js b/examples/two_sections.js new file mode 100644 index 0000000..8546f64 --- /dev/null +++ b/examples/two_sections.js @@ -0,0 +1 @@ +var two_sections = {}; \ No newline at end of file diff --git a/examples/two_sections.txt b/examples/two_sections.txt new file mode 100644 index 0000000..c634376 --- /dev/null +++ b/examples/two_sections.txt @@ -0,0 +1,3 @@ + BAR bar + BAR bar + BAR bar diff --git a/test/mustache_spec.rb b/test/mustache_spec.rb index a49603d..6656703 100644 --- a/test/mustache_spec.rb +++ b/test/mustache_spec.rb @@ -92,6 +92,25 @@ describe "mustache" do run_js(js).strip.should == "foo BAR" end + it "should not suck" do + js = <<-JS + try{ + #{@boilerplate} + + print(Mustache.to_html("{{#foo}}\\ +{{/foo}}\\ +{{#bar}}\\ +{{/bar}}\\ +", {})); + } catch(e) { + print(e); + } + JS + + run_js(js).should == "foanfs" + end + + non_partials.each do |testname| describe testname do it "should generate the correct html" do