diff --git a/dnSpy/dnSpy.Contracts.DnSpy/Documents/TreeView/Resources/ResourceElementNode.cs b/dnSpy/dnSpy.Contracts.DnSpy/Documents/TreeView/Resources/ResourceElementNode.cs index 0528d28623..618909f1aa 100644 --- a/dnSpy/dnSpy.Contracts.DnSpy/Documents/TreeView/Resources/ResourceElementNode.cs +++ b/dnSpy/dnSpy.Contracts.DnSpy/Documents/TreeView/Resources/ResourceElementNode.cs @@ -49,11 +49,11 @@ public abstract class ResourceElementNode : DocumentTreeNodeData, IResourceNode /// protected sealed override void WriteCore(ITextColorWriter output, IDecompiler decompiler, DocumentNodeWriteOptions options) { - output.WriteFilename(Uri.UnescapeDataString(resourceElement.Name)); + output.WriteFilenameIdentifier(Uri.UnescapeDataString(resourceElement.Name)); if ((options & DocumentNodeWriteOptions.ToolTip) != 0) { if (TreeNode.Parent?.Data is ResourceNode parentNode) { output.WriteLine(); - output.WriteFilename(parentNode.Name); + output.WriteFilenameIdentifier(parentNode.Name); } output.WriteLine(); WriteFilename(output); diff --git a/dnSpy/dnSpy.Contracts.Logic/Text/ITextColorWriterExtensions.cs b/dnSpy/dnSpy.Contracts.Logic/Text/ITextColorWriterExtensions.cs index a0ae606a18..1349b0cce5 100644 --- a/dnSpy/dnSpy.Contracts.Logic/Text/ITextColorWriterExtensions.cs +++ b/dnSpy/dnSpy.Contracts.Logic/Text/ITextColorWriterExtensions.cs @@ -223,7 +223,7 @@ public static T WriteFilenameIdentifier(this T output, string? filename) wher var parts = s.Split('/'); int slashIndex = 0; for (int i = 0; i < parts.Length - 1; i++) { - output.Write(BoxedTextColor.DirectoryPart, IdentifierEscaper.Escape(parts[i])); + output.Write(BoxedTextColor.DirectoryPart, IdentifierEscaper.Escape(parts[i], true)); slashIndex += parts[i].Length; output.Write(BoxedTextColor.Text, filename[slashIndex].ToString()); slashIndex++; @@ -231,11 +231,11 @@ public static T WriteFilenameIdentifier(this T output, string? filename) wher var fn = parts[parts.Length - 1]; int index = fn.LastIndexOf('.'); if (index < 0) - output.Write(BoxedTextColor.FileNameNoExtension, IdentifierEscaper.Escape(fn)); + output.Write(BoxedTextColor.FileNameNoExtension, IdentifierEscaper.Escape(fn, true)); else { string ext = fn.Substring(index + 1); fn = fn.Substring(0, index); - output.Write(BoxedTextColor.FileNameNoExtension, IdentifierEscaper.Escape(fn)); + output.Write(BoxedTextColor.FileNameNoExtension, IdentifierEscaper.Escape(fn, true)); output.Write(BoxedTextColor.Text, "."); output.Write(BoxedTextColor.FileExtension, ext); }