Jeff-Lewis / nhaml

Automatically exported from code.google.com/p/nhaml
0 stars 0 forks source link

Fluent method chain with lambdas causes compilation error #61

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
- Html.jQuery().Accordion().Name("navigation").Items() (parent) =>
  - parent.Add().Text("Accordion").Content() () =>
    %ul
      %li= Html.ActionLink("Basic example", "Basic", "Accordion")
- .Render()

Results in:

// Haml: - Html.jQuery().Accordion().Name("navigation").Items() (parent) =>
Html.jQuery().Accordion().Name("navigation").Items((parent) => {;
// Haml:   - parent.Add().Text("Accordion").Content() () =>
Output.Depth = 1;
parent.Add().Text("Accordion").Content(() => {;
textWriter.Write("    <ul");
textWriter.WriteLine(">");
textWriter.Write("      <li");
textWriter.WriteLine(">");
textWriter.Write("        ");
textWriter.WriteLine(Convert.ToString(Html.ActionLink("Basic example", "Basic", 
"Accordion")));
textWriter.WriteLine("      </li>");
textWriter.WriteLine("    </ul>");
});
Output.Depth = 0;
});
// Haml: - .Render()
.Render();

The last Render call is orphaned.

Original issue reported on code.google.com by andrew.j...@gmail.com on 29 Jul 2009 at 5:54

GoogleCodeExporter commented 9 years ago
workaround

- Html.jQuery().Accordion().Name("navigation").Items() (parent) =>
  - parent.Add().Text("Accordion").Content() () =>
    %ul
      %li= Html.ActionLink("Basic example", "Basic", "Accordion").Render()

Original comment by simon.cropp@gmail.com on 2 Aug 2009 at 10:37

GoogleCodeExporter commented 9 years ago
Andrew

Knowing the codebase as well as you do... do u have any suggestions for how fix 
this?

Original comment by simon.cropp@gmail.com on 2 Aug 2009 at 10:38