Skip to content

Commit aeca9b4

Browse files
committed
Additional sanitizing at template rendering time
The existing santizing wasn't enough. Fixes #155
1 parent 7809ad3 commit aeca9b4

File tree

4 files changed

+9
-10
lines changed

4 files changed

+9
-10
lines changed

src/ThisAssembly.Constants/CSharp.sbntxt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@
1818
/// </summary>
1919
{{ end }}
2020
{{ func render }}
21-
public static partial class {{ $0.Name }}
21+
public static partial class {{ $0.Name | string.replace "-" "_" | string.replace " " "_" }}
2222
{
2323
{{~ for value in $0.Values ~}}
2424
{{- summary value ~}}
25-
public const string {{ value.Name }} = @"{{ value.Value }}";
25+
public const string {{ value.Name | string.replace "-" "_" | string.replace " " "_" }} = @"{{ value.Value }}";
2626
{{~ end ~}}
2727

2828
{{ for area in $0.NestedAreas

src/ThisAssembly.Resources/CSharp.sbntxt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
/// => @"{{ $0.Path }}"
1717
{{~ end ~}}
1818
/// </summary>
19-
public static partial class {{ $0.Name }}
19+
public static partial class {{ $0.Name | string.replace "-" "_" | string.replace " " "_" }}
2020
{
2121
{{~ if $0.IsText ~}}
2222
private static string text;
@@ -31,7 +31,7 @@
3131
}
3232
{{ end }}
3333
{{ func render }}
34-
public static partial class {{ $0.Name }}
34+
public static partial class {{ $0.Name | string.replace "-" "_" | string.replace " " "_" }}
3535
{
3636
{{~ if $0.Resources ~}}
3737
{{~ for $r in $0.Resources ~}}

src/ThisAssembly.Tests/ThisAssembly.Tests.csproj

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,12 @@
3535
</ItemGroup>
3636

3737
<ItemGroup>
38-
<EmbeddedResource Update="Resources.resx">
39-
<Generator></Generator>
40-
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
41-
</EmbeddedResource>
42-
38+
<EmbeddedResource Update="Resources.resx" Generator="" CopyToOutputDirectory="PreserveNewest" />
4339
<EmbeddedResource Include="Content/Styles/Custom.css" Kind="Text" Comment="Secondary CSS" />
4440
<EmbeddedResource Include="Content/Styles/Main.css" Comment="Primary CSS" />
4541
<EmbeddedResource Include="Content/Docs/*" />
4642
<EmbeddedResource Include="Content/Swagger/*" />
47-
<None Remove="Content/Swagger/*" />
43+
<EmbeddedResource Include="webhook-data.json" Kind="text" />
4844
</ItemGroup>
4945

5046
<PropertyGroup>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
3+
}

0 commit comments

Comments
 (0)