Skip to content

Commit 4995bbf

Browse files
authored
Use '~' to represent non-HTML characters in HTML projected document (#25027)
1 parent 55ce868 commit 4995bbf

File tree

72 files changed

+630
-630
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+630
-630
lines changed
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1+
~~~~~~~~~~ ~~~~~~~~~~~~~~
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
2-
<div class=" ">
1+
~~~~~~~~~~~ ~~~~~~~~~~~
2+
<div class="~~~~~~~~~~~~~~~~">
33
Hello world
4-
4+
~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~
55
</div>
66

7-
8-
9-
7+
~~~~~~~~~~ ~
8+
~~~~ ~~~~~~~~~~~~~~~~~~~~~~ ~
9+
~
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
<div class=" ">
1+
<div class="~~~~~~~~~~~~~~~~">
22
Hello world
3-
3+
~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~
44
</div>
5-
6-
7-
8-
<p class=" " />
5+
~~
6+
~~~ ~~~ ~ ~~~~~~
7+
~
8+
<p class="~~~~~~~ ~~ ~~~~~ ~ ~~~~ ~" />
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
1+
~~ ~~~~~ ~~~~ ~~~~~ ~~~~~~~~ ~~~~ ~~~~~~~~~~~ ~~~~~~~~~~ ~~~~~~~~~~ ~~~~~ ~~~~~~ ~~
22

3-
4-
5-
"
3+
~~~~~
4+
~~~~~
5+
~~~~~ "
66

7-
8-
7+
~~~~~~
8+
~~~~~~
99

10-
11-
12-
10+
~~~~~~~
11+
~~~~~~~
12+
~~~~~~~ ~~~~~~~~~~~~~~~~~
1313

14-
15-
14+
~~~~~~~~~~
15+
~~~~~~~~~~
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
2-
1+
~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~
2+
~~~~~~ ~~~~~~~
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
2-
1+
~~~~~
2+
~~~~~~ ~~~~~~~
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
2-
3-
1+
~~~~~~ ~~~~~~~
2+
~~~~~~~ ~~~~~ ~~~~~~~~~~~~~~
3+
~~~~~~~ ~~~~~~~~~~~~~~~~~ ~~~~
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
2-
3-
4-
5-
1+
~~~~~~ ~~~~~~~
2+
~~~~~~~ ~~~~~ ~~~~~~~~~~~~~~~
3+
~~~~~~~ ~~~~~~~~~~~~~~~~~ ~~~~~
4+
~~~~~~~ ~~~~~ ~~~~~~~~~~~~~~~ ~
5+
~~~~~~~ ~~~~~~~~~~~~~~~~~ ~~~~~ ~
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1+
~~~~~~~ ~~~~~ ~~~~~~~~~~~~~~
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Test.
1+
~~~~~~~~~~ Test.
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"foo
1+
~~~~~ "foo
22

33
<h1>About Us</h1>
44
<p>We are awesome.</p>
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
1+
~~~~~~ ~~~~~~~~
22

3-
3+
~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~
44

5-
<input-test for=" " />
6-
<input-test for=" " />
5+
<input-test for="~~~~" />
6+
<input-test for="~~~~~~" />
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1+
~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
2-
1+
~~~~~~ ~~~~~~~~~~~~~~~~~~~~~
2+
~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
2-
1+
~~~~~
2+
~~~~~~~~~~ ~~~~~~~~~~~~~~
33
<h1>Hi There!</h1>
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
<div>Some text here.</div>
2-
2+
~~~~~
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
1+
~~~~~ ~~~~~~~~
22

3-
4-
3+
~~~~~~ ~~~~~~~~
4+
~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
55

6-
7-
8-
9-
10-
11-
6+
~~~~~~~~~~ ~
7+
~~~~~~ ~~~~~ ~~~~~~~~ ~ ~~~~~~~~~
8+
~
9+
~~~~~~ ~~~~~~ ~~~~ ~ ~~~~ ~~~~ ~
10+
~
11+
~
1212

13-
<h1>New Customer </h1>
13+
<h1>New Customer ~~~~~~~~~~~</h1>

src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPagesWithoutModel_DesignTime.codegen.html

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
1-
1+
~~~~~
22

3-
4-
3+
~~~~~~~~~~~~~ ~~~ ~~~~~~~~
4+
~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
55

6-
7-
8-
9-
10-
11-
6+
~~~~~~~~~~ ~
7+
~~~~~~ ~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~ ~~~~~~~~~
8+
~
9+
~~~~ ~ ~~~~~~~~~~~~~~
10+
~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
11+
~
1212

13-
13+
~~~~~~ ~~~~~~ ~~~~ ~ ~~~~ ~~~~ ~
1414

15-
16-
17-
18-
19-
15+
~~~~~~ ~~~~~ ~~~~~~~~
16+
~
17+
~~~~~~ ~~~~~~ ~~~~ ~ ~~~~ ~~~~ ~
18+
~
19+
~
2020

2121
<h1>New Customer</h1>
2222
<form method="post" class="form-horizontal">
2323
<div class="text-danger"></div>
2424
<div class="form-group">
25-
<label class="col-md-2 control-label"> </label>
25+
<label class="col-md-2 control-label">~~~~~</label>
2626
<div class="col-md-10">
2727
<input class="form-control" />
2828
<span class="text-danger"></span>

src/Razor/Microsoft.AspNetCore.Mvc.Razor.Extensions/test/TestFiles/IntegrationTests/CodeGenerationIntegrationTest/RazorPages_DesignTime.codegen.html

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,32 @@
1-
1+
~~~~~
22

3-
4-
5-
3+
~~~~~~ ~~~~~~~~
4+
~~~~~~~~~~~~~ ~~~ ~~~~~~~~
5+
~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
66

7-
8-
9-
10-
11-
12-
13-
14-
7+
~~~~~~~~~~ ~
8+
~~~~~~ ~~~~~ ~~~~~~~~ ~ ~~~~~~~~~
9+
~
10+
~~~~~~ ~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~ ~~~~~~~~~
11+
~
12+
~~~~ ~ ~~~~~~~~~~~~~~
13+
~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
14+
~
1515

16-
17-
16+
~~~~~~ ~~~~~~ ~~~~ ~ ~~~~ ~~~~ ~
17+
~
1818

19-
20-
21-
22-
23-
19+
~~~~~~ ~~~~~ ~~~~~~~~
20+
~
21+
~~~~~~ ~~~~~~ ~~~~ ~ ~~~~ ~~~~ ~
22+
~
23+
~
2424

2525
<h1>New Customer</h1>
2626
<form method="post" class="form-horizontal" >
2727
<div class="text-danger"></div>
2828
<div class="form-group">
29-
<label class="col-md-2 control-label"> </label>
29+
<label class="col-md-2 control-label">~~~~~~~~~~~</label>
3030
<div class="col-md-10">
3131
<input class="form-control" />
3232
<span class="text-danger"></span>
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
1+
~~~~~~ ~~~~~~~~
22

3-
3+
~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~
44

5-
6-
7-
5+
~~
6+
~~~~~~ ~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
7+
~
88

99
<div>Some body</div>
1010

11-
11+
~~~~~~~~ ~~~~~~~~ ~
1212
<div>This is in Section 1</div>
13-
<input-test for=" " />
14-
13+
<input-test for="~~~~" />
14+
~
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
2-
3-
4-
1+
~~~~~~ ~~~~~~~~~~~~~~~~~~~~~
2+
~~~~~~ ~~~~~~~~~~~~~~~~~~
3+
~~~~~~ ~~~~~~
4+
~~~~~~ ~~~~~~
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
2-
3-
4-
1+
~~~~~~~~~~~~~ ~~~ ~~~~~~~~
2+
~~
3+
~~~ ~~~ ~ ~~~~~~~~
4+
~
55

6-
<vc:test first-name=" " bar=" World"></vc:test>
6+
<vc:test first-name="~~~~" bar=" World"></vc:test>
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
1+
~~~~~~~~~~ ~~~~~~~~~~~~~~
22
<h1>Hi There!</h1>
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1+
~~~~~~~ ~~~~~~~~~~~~~~~~~~~ ~~~~~~

src/Razor/Microsoft.AspNetCore.Razor.Language/src/RazorHtmlWriter.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) .NET Foundation. All rights reserved.
1+
// Copyright (c) .NET Foundation. All rights reserved.
22
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
33

44
using System;
@@ -141,7 +141,7 @@ private void WriteToken(SyntaxToken token)
141141
return;
142142
}
143143

144-
// We're in non-HTML context. Let's replace all non-whitespace chars with a space.
144+
// We're in non-HTML context. Let's replace all non-whitespace chars with a tilde(~).
145145
foreach (var c in content)
146146
{
147147
if (char.IsWhiteSpace(c))
@@ -150,7 +150,7 @@ private void WriteToken(SyntaxToken token)
150150
}
151151
else
152152
{
153-
Builder.Append(' ');
153+
Builder.Append('~');
154154
}
155155
}
156156
}
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1+
~~~~~~~~~~~~~ ~~~ ~~~~~~~~~~~~~
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
2-
3-
4-
1+
~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2+
~~~~~~~~~~ ~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~
3+
~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~
4+
~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~
55

66
Hello World

0 commit comments

Comments
 (0)