Skip to content
This repository was archived by the owner on Dec 19, 2018. It is now read-only.

Commit 79f4b66

Browse files
committed
minor changes
1 parent b8af599 commit 79f4b66

File tree

3 files changed

+19
-11
lines changed

3 files changed

+19
-11
lines changed

test/Microsoft.AspNet.Razor.Test/Parser/Html/HtmlAttributeTest.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@ public void SimpleLiteralAttribute()
3131
[Fact]
3232
public void SimpleLiteralAttributeWithWhitespaceSurroundingEquals()
3333
{
34-
ParseBlockTest($"<a href {Environment.NewLine}= {Environment.NewLine}'Foo' />",
34+
ParseBlockTest($"<a href \f{Environment.NewLine}= \t{Environment.NewLine}'Foo' />",
3535
new MarkupBlock(
3636
new MarkupTagBlock(
3737
Factory.Markup("<a"),
38-
new MarkupBlock(new AttributeBlockChunkGenerator(name: "href", prefix: new LocationTagged<string>($" href {Environment.NewLine}= {Environment.NewLine}'", 2, 0, 2), suffix: new LocationTagged<string>("'", 18, 2, 4)),
39-
Factory.Markup($" href {Environment.NewLine}= {Environment.NewLine}'").With(SpanChunkGenerator.Null),
40-
Factory.Markup("Foo").With(new LiteralAttributeChunkGenerator(prefix: new LocationTagged<string>(string.Empty, 15, 2, 1), value: new LocationTagged<string>("Foo", 15, 2, 1))),
38+
new MarkupBlock(new AttributeBlockChunkGenerator(name: "href", prefix: new LocationTagged<string>($" href \f{Environment.NewLine}= \t{Environment.NewLine}'", 2, 0, 2), suffix: new LocationTagged<string>("'", 20, 2, 4)),
39+
Factory.Markup($" href \f{Environment.NewLine}= \t{Environment.NewLine}'").With(SpanChunkGenerator.Null),
40+
Factory.Markup("Foo").With(new LiteralAttributeChunkGenerator(prefix: new LocationTagged<string>(string.Empty, 17, 2, 1), value: new LocationTagged<string>("Foo", 17, 2, 1))),
4141
Factory.Markup("'").With(SpanChunkGenerator.Null)),
4242
Factory.Markup(" />").Accepts(AcceptedCharacters.None))));
4343
}

test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/Output/TagHelpersWithWeirdlySpacedAttributes.cs

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#pragma checksum "TagHelpersWithWeirdlySpacedAttributes.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "28d049638bc8b665f1a0b5fa1e3704261e413e5a"
1+
#pragma checksum "TagHelpersWithWeirdlySpacedAttributes.cshtml" "{ff1816ec-aa5e-4d10-87f7-6f4963833460}" "929d88adc7e4853aea859bc2c7dc989954bcc351"
22
namespace TestOutput
33
{
44
using Microsoft.AspNet.Razor.Runtime.TagHelpers;
@@ -30,7 +30,7 @@ public override async Task ExecuteAsync()
3030
WriteLiteral("\r\n");
3131
Instrumentation.EndContext();
3232
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("p", TagMode.StartTagAndEndTag, "test", async() => {
33-
Instrumentation.BeginContext(84, 11, true);
33+
Instrumentation.BeginContext(105, 11, true);
3434
WriteLiteral("Body of Tag");
3535
Instrumentation.EndContext();
3636
}
@@ -44,12 +44,20 @@ public override async Task ExecuteAsync()
4444
#line default
4545
#line hidden
4646
__tagHelperExecutionContext.AddTagHelperAttribute("age", __PTagHelper.Age);
47+
StartTagHelperWritingScope();
48+
#line 7 "TagHelpersWithWeirdlySpacedAttributes.cshtml"
49+
Write(true);
50+
51+
#line default
52+
#line hidden
53+
__tagHelperStringValueBuffer = EndTagHelperWritingScope();
54+
__tagHelperExecutionContext.AddHtmlAttribute("data-content", Html.Raw(__tagHelperStringValueBuffer.ToString()));
4755
__tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
48-
Instrumentation.BeginContext(35, 64, false);
56+
Instrumentation.BeginContext(35, 85, false);
4957
await WriteTagHelperAsync(__tagHelperExecutionContext);
5058
Instrumentation.EndContext();
5159
__tagHelperExecutionContext = __tagHelperScopeManager.End();
52-
Instrumentation.BeginContext(99, 4, true);
60+
Instrumentation.BeginContext(120, 4, true);
5361
WriteLiteral("\r\n\r\n");
5462
Instrumentation.EndContext();
5563
__tagHelperExecutionContext = __tagHelperScopeManager.Begin("input", TagMode.SelfClosing, "test", async() => {
@@ -64,7 +72,7 @@ public override async Task ExecuteAsync()
6472
__InputTagHelper2.Type = __InputTagHelper.Type;
6573
__tagHelperExecutionContext.AddHtmlAttribute("data-content", Html.Raw("hello"));
6674
__tagHelperExecutionContext.Output = await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);
67-
Instrumentation.BeginContext(103, 45, false);
75+
Instrumentation.BeginContext(124, 47, false);
6876
await WriteTagHelperAsync(__tagHelperExecutionContext);
6977
Instrumentation.EndContext();
7078
__tagHelperExecutionContext = __tagHelperScopeManager.End();

test/Microsoft.AspNet.Razor.Test/TestFiles/CodeGenerator/Source/TagHelpersWithWeirdlySpacedAttributes.cshtml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
class
55
=
66
"Hello World" age =1337
7-
>Body of Tag</p>
7+
data-content= "@true">Body of Tag</p>
88

9-
<input type = 'text' data-content= "hello" />
9+
<input type = 'text' data-content= "hello" />

0 commit comments

Comments
 (0)