More bug fix for #379
This commit is contained in:
parent
0e296283f9
commit
aaa14cd36b
|
|
@ -1049,19 +1049,22 @@ namespace Microsoft.AspNet.Razor.Parser
|
||||||
tags.Clear();
|
tags.Clear();
|
||||||
if (!Context.DesignTimeMode)
|
if (!Context.DesignTimeMode)
|
||||||
{
|
{
|
||||||
if (Context.LastSpan.Kind == SpanKind.Transition)
|
if (At(HtmlSymbolType.WhiteSpace))
|
||||||
{
|
{
|
||||||
// Output current span content as markup.
|
if (Context.LastSpan.Kind == SpanKind.Transition)
|
||||||
Output(SpanKind.Markup);
|
{
|
||||||
|
// Output current span content as markup.
|
||||||
|
Output(SpanKind.Markup);
|
||||||
|
|
||||||
// Accept and mark the whitespace at the end of a <text> tag as code.
|
// Accept and mark the whitespace at the end of a <text> tag as code.
|
||||||
AcceptWhile(HtmlSymbolType.WhiteSpace);
|
AcceptWhile(HtmlSymbolType.WhiteSpace);
|
||||||
Span.CodeGenerator = new StatementCodeGenerator();
|
Span.CodeGenerator = new StatementCodeGenerator();
|
||||||
Output(SpanKind.Code);
|
Output(SpanKind.Code);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
AcceptWhile(HtmlSymbolType.WhiteSpace);
|
AcceptWhile(HtmlSymbolType.WhiteSpace);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!EndOfFile && CurrentSymbol.Type == HtmlSymbolType.NewLine)
|
if (!EndOfFile && CurrentSymbol.Type == HtmlSymbolType.NewLine)
|
||||||
|
|
|
||||||
|
|
@ -647,7 +647,7 @@ namespace Microsoft.AspNet.Razor.Test.Parser.CSharp
|
||||||
),
|
),
|
||||||
new MarkupTagBlock(
|
new MarkupTagBlock(
|
||||||
Factory.MarkupTransition("</text>").Accepts(AcceptedCharacters.None)),
|
Factory.MarkupTransition("</text>").Accepts(AcceptedCharacters.None)),
|
||||||
Factory.Markup(Environment.NewLine).With(new StatementCodeGenerator()).Accepts(AcceptedCharacters.None)
|
Factory.Markup(Environment.NewLine).Accepts(AcceptedCharacters.None)
|
||||||
),
|
),
|
||||||
Factory.Code($" }}{Environment.NewLine} if(!false) {{{Environment.NewLine}").AsStatement(),
|
Factory.Code($" }}{Environment.NewLine} if(!false) {{{Environment.NewLine}").AsStatement(),
|
||||||
new MarkupBlock(
|
new MarkupBlock(
|
||||||
|
|
|
||||||
|
|
@ -49,12 +49,9 @@ namespace TestOutput
|
||||||
#line default
|
#line default
|
||||||
#line hidden
|
#line hidden
|
||||||
Instrumentation.EndContext();
|
Instrumentation.EndContext();
|
||||||
#line 3 "CodeBlockWithTextElement.cshtml"
|
Instrumentation.BeginContext(80, 2, true);
|
||||||
|
WriteLiteral("\r\n");
|
||||||
|
Instrumentation.EndContext();
|
||||||
#line default
|
|
||||||
#line hidden
|
|
||||||
|
|
||||||
#line 4 "CodeBlockWithTextElement.cshtml"
|
#line 4 "CodeBlockWithTextElement.cshtml"
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
|
|
|
||||||
|
|
@ -81,15 +81,9 @@ namespace TestOutput
|
||||||
Instrumentation.EndContext();
|
Instrumentation.EndContext();
|
||||||
WriteAttribute("href", Tuple.Create(" href=\"", 387), Tuple.Create("\"", 442), Tuple.Create(Tuple.Create("", 394), Tuple.Create<System.Object, System.Int32>(Href("~/A+Really(Crazy),Url.Is:This/"), 394), false),
|
WriteAttribute("href", Tuple.Create(" href=\"", 387), Tuple.Create("\"", 442), Tuple.Create(Tuple.Create("", 394), Tuple.Create<System.Object, System.Int32>(Href("~/A+Really(Crazy),Url.Is:This/"), 394), false),
|
||||||
Tuple.Create(Tuple.Create("", 424), Tuple.Create<System.Object, System.Int32>(product.id, 424), false), Tuple.Create(Tuple.Create("", 435), Tuple.Create("/Detail", 435), true));
|
Tuple.Create(Tuple.Create("", 424), Tuple.Create<System.Object, System.Int32>(product.id, 424), false), Tuple.Create(Tuple.Create("", 435), Tuple.Create("/Detail", 435), true));
|
||||||
Instrumentation.BeginContext(443, 21, true);
|
Instrumentation.BeginContext(443, 23, true);
|
||||||
WriteLiteral(">Crazy Url!</a>\r\n ");
|
WriteLiteral(">Crazy Url!</a>\r\n \r\n");
|
||||||
Instrumentation.EndContext();
|
Instrumentation.EndContext();
|
||||||
#line 12 "ResolveUrl.cshtml"
|
|
||||||
|
|
||||||
|
|
||||||
#line default
|
|
||||||
#line hidden
|
|
||||||
|
|
||||||
#line 13 "ResolveUrl.cshtml"
|
#line 13 "ResolveUrl.cshtml"
|
||||||
|
|
||||||
#line default
|
#line default
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue