Skip to content

Commit

Permalink
Update the prefix string.
Browse files Browse the repository at this point in the history
Follow @h3xds1nz 's suggestion.
  • Loading branch information
lindexi committed Feb 21, 2025
1 parent d12f04f commit 031cfea
Showing 1 changed file with 4 additions and 18 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Licensed to the .NET Foundation under one or more agreements.
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

Expand Down Expand Up @@ -82,25 +82,11 @@ internal static void GetClipboardContentForHtml(StringBuilder content)

int bytecountEndOfFragment = bytecountPrefixContext + destinationBytes.Length;
int bytecountEndOfHtml = bytecountEndOfFragment + bytecountSuffixContext;
const string htmlStartFragment = "<HTML>\r\n<BODY>\r\n<!--StartFragment-->";
string prefix = string.Create(CultureInfo.InvariantCulture,
$"""
Version:1.0
StartHTML:00000097
EndHTML:{bytecountEndOfHtml:00000000}
StartFragment:00000133
EndFragment:{bytecountEndOfFragment:00000000}
<HTML>
<BODY>
<!--StartFragment-->
""");
$"Version:1.0\r\nStartHTML:00000097\r\nEndHTML:{bytecountEndOfHtml:00000000}\r\nStartFragment:00000133\r\nEndFragment:{bytecountEndOfFragment:00000000}\r\n{htmlStartFragment}");
content.Insert(0, prefix);
content.Append(
"""
<!--EndFragment-->
</BODY>
</HTML>
""");
content.Append("\r\n<!--EndFragment-->\r\n</BODY>\r\n</HTML>");
}

private static void FormatPlainText(string s, bool csv, TextWriter output, ref bool escapeApplied)
Expand Down

0 comments on commit 031cfea

Please sign in to comment.