Skip to content

Commit

Permalink
Use CDATA
Browse files Browse the repository at this point in the history
  • Loading branch information
Cosifne committed Jun 17, 2021
1 parent c350df2 commit 6e42437
Showing 1 changed file with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

using System.Collections.Immutable;
using System.Linq;
using System.Security;
using System.Threading;
using System.Threading.Tasks;
using Microsoft.CodeAnalysis.Editor.UnitTests.Workspaces;
Expand All @@ -22,8 +21,6 @@ namespace Microsoft.CodeAnalysis.Editor.UnitTests.InheritanceMargin
public class InheritanceMarginTests
{
private const string SearchAreaTag = "SeachTag";
private static readonly string s_lessThanToken = SecurityElement.Escape("<");
private static readonly string s_greaterThanToken = SecurityElement.Escape(">");

#region Helpers

Expand All @@ -35,8 +32,8 @@ private static Task VerifyInSingleDocumentAsync(
string languageName,
params TestInheritanceMemberItem[] memberItems)
{
// Escapse < and > for xml
markup = markup.Replace("<", s_lessThanToken).Replace(">", s_greaterThanToken);
markup = @$"<![CDATA[
{markup}]]>";

var workspaceFile = $@"
<Workspace>
Expand Down Expand Up @@ -143,12 +140,14 @@ private static async Task VerifyInDifferentProjectsAsync(
<Project Language=""{markup1.languageName}"" AssemblyName=""Assembly1"" CommonReferences=""true"">
<ProjectReference>Assembly2</ProjectReference>
<Document>
{markup1.markupInProject1.Replace("<", s_lessThanToken).Replace(">", s_greaterThanToken)}
<![CDATA[
{markup1.markupInProject1}]]>
</Document>
</Project>
<Project Language=""{markup2.languageName}"" AssemblyName=""Assembly2"" CommonReferences=""true"">
<Document>
{markup2.markupInProject2.Replace("<", s_lessThanToken).Replace(">", s_greaterThanToken)}
<![CDATA[
{markup2.markupInProject2}]]>
</Document>
</Project>
</Workspace>";
Expand Down

0 comments on commit 6e42437

Please sign in to comment.