From 62ce985be84047a7efba6e6eda1cc44c23d83527 Mon Sep 17 00:00:00 2001 From: ayende Date: Fri, 6 Apr 2007 22:26:23 +0000 Subject: [PATCH] Fixing regression with <% code %> blocks that don't span lines. git-svn-id: https://svn.castleproject.org/svn/castle/trunk@3688 73e77b4c-caa6-f847-a29a-24ab75ae54b6 --- .../BrailBasicFunctionality.cs | 10 ++++++++++ MonoRail/Castle.MonoRail.Views.Brail/BrailPreProcessor.cs | 2 +- MonoRail/TestSiteBrail/Controllers/HomeController.cs | 5 +++++ MonoRail/TestSiteBrail/TestSiteBrail.csproj | 1 + 4 files changed, 17 insertions(+), 1 deletion(-) diff --git a/MonoRail/Castle.MonoRail.Views.Brail.Tests/BrailBasicFunctionality.cs b/MonoRail/Castle.MonoRail.Views.Brail.Tests/BrailBasicFunctionality.cs index de3622dd6..315889801 100644 --- a/MonoRail/Castle.MonoRail.Views.Brail.Tests/BrailBasicFunctionality.cs +++ b/MonoRail/Castle.MonoRail.Views.Brail.Tests/BrailBasicFunctionality.cs @@ -183,5 +183,15 @@ end"; DoGet("home/complexNestedExpressions.rails"); AssertReplyEqualTo(expected); } + + [Test] + public void OutputSubViewInDiv() + { + string expected = @"
+Contents for heyhello View +
"; + DoGet("home/subview.rails"); + AssertReplyEqualTo(expected); + } } } diff --git a/MonoRail/Castle.MonoRail.Views.Brail/BrailPreProcessor.cs b/MonoRail/Castle.MonoRail.Views.Brail/BrailPreProcessor.cs index 6a4f39856..9327beb10 100644 --- a/MonoRail/Castle.MonoRail.Views.Brail/BrailPreProcessor.cs +++ b/MonoRail/Castle.MonoRail.Views.Brail/BrailPreProcessor.cs @@ -108,7 +108,7 @@ namespace Castle.MonoRail.Views.Brail lastIndex = code.IndexOf(end, startReading); if (lastIndex == -1) throw new RailsException("expected " + end); - buffer.Write(code.Substring(startReading, lastIndex - startReading)); + buffer.WriteLine(code.Substring(startReading, lastIndex - startReading)); lastIndex += end.Length; } Output(buffer, code.Substring(lastIndex)); diff --git a/MonoRail/TestSiteBrail/Controllers/HomeController.cs b/MonoRail/TestSiteBrail/Controllers/HomeController.cs index 6acfe2978..4cce93b68 100644 --- a/MonoRail/TestSiteBrail/Controllers/HomeController.cs +++ b/MonoRail/TestSiteBrail/Controllers/HomeController.cs @@ -139,6 +139,11 @@ namespace Castle.MonoRail.Views.Brail.TestSite.Controllers { } + + public void SubView() + { + + } } } diff --git a/MonoRail/TestSiteBrail/TestSiteBrail.csproj b/MonoRail/TestSiteBrail/TestSiteBrail.csproj index bdf547bad..05684ce33 100644 --- a/MonoRail/TestSiteBrail/TestSiteBrail.csproj +++ b/MonoRail/TestSiteBrail/TestSiteBrail.csproj @@ -133,6 +133,7 @@ + -- 2.11.4.GIT