File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -65,4 +65,20 @@ func TestRepoFile(t *testing.T) {
6565<a href="/user2/repo1/media/commit/1234/image" target="_blank" rel="nofollow noopener"><img src="/user2/repo1/media/commit/1234/image" alt="/image"/></a></p> 
6666` , rendered )
6767	})
68+ 
69+ 	t .Run ("WithCurrentRefPathByTag" , func (t  * testing.T ) {
70+ 		rctx  :=  NewRenderContextRepoFile (context .Background (), repo1 , RepoFileOptions {
71+ 			CurrentRefPath :  "/commit/1234" ,
72+ 			CurrentTreePath : "my-dir" ,
73+ 		}).
74+ 			WithMarkupType (markdown .MarkupName )
75+ 		rendered , err  :=  markup .RenderString (rctx , ` 
76+ <img src="LINK"> 
77+ <video src="LINK"> 
78+ ` )
79+ 		assert .NoError (t , err )
80+ 		assert .Equal (t , `<a href="/user2/repo1/media/commit/1234/my-dir/LINK/" target="_blank" rel="nofollow noopener"><img src="/user2/repo1/media/commit/1234/my-dir/LINK/"/></a> 
81+ <video src="/user2/repo1/media/commit/1234/my-dir/LINK/"> 
82+ </video>` , rendered )
83+ 	})
6884}
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments