@@ -52,9 +52,11 @@ protected override void Initialize() { }
5252
5353 public static bool IsDirSep ( char c ) => c == '\\ ' || c == '/' ;
5454
55+ public const string Base64Modifier = "|base64" ;
56+
5557 public static bool GetGistContents ( string filePath , Gist gist , out string text , out MemoryStream stream )
5658 {
57- var base64FilePath = filePath + "|base64" ;
59+ var base64FilePath = filePath + Base64Modifier ;
5860 foreach ( var entry in gist . Files )
5961 {
6062 var file = entry . Value ;
@@ -214,7 +216,7 @@ public void WriteFile(string virtualPath, string contents)
214216 public void WriteFile ( string virtualPath , Stream stream )
215217 {
216218 var base64 = ToBase64 ( stream ) ;
217- var filePath = SanitizePath ( virtualPath ) + "|base64" ;
219+ var filePath = SanitizePath ( virtualPath ) + Base64Modifier ;
218220 Gateway . WriteGistFile ( GistId , filePath , base64 ) ;
219221 ClearGist ( ) ;
220222 }
@@ -248,7 +250,7 @@ public void AppendFile(string filePath, Stream stream)
248250 public string ResolveGistFileName ( string filePath )
249251 {
250252 var gist = GetGist ( ) ;
251- var baseFilePath = filePath + "|base64" ;
253+ var baseFilePath = filePath + Base64Modifier ;
252254 foreach ( var entry in gist . Files )
253255 {
254256 if ( entry . Key == filePath || entry . Key == baseFilePath )
@@ -379,6 +381,8 @@ public class GistVirtualFile : AbstractVirtualFileBase
379381
380382 public string GistId => PathProvider . GistId ;
381383
384+ public override string Extension => Name . LastRightPart ( '.' ) . LeftPart ( '|' ) ;
385+
382386 public GistVirtualFile ( GistVirtualFiles pathProvider , IVirtualDirectory directory )
383387 : base ( pathProvider , directory )
384388 {
0 commit comments