mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 08:30:25 +08:00 
			
		
		
		
	Remove deadcode (#22245)
- Remove code that isn't being used. Found this is my stash from a few weeks ago, not sure how I found this in the first place. Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
This commit is contained in:
		@@ -289,9 +289,3 @@ func RenderRawString(ctx *markup.RenderContext, content string) (string, error)
 | 
			
		||||
	}
 | 
			
		||||
	return buf.String(), nil
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// IsMarkdownFile reports whether name looks like a Markdown file
 | 
			
		||||
// based on its extension.
 | 
			
		||||
func IsMarkdownFile(name string) bool {
 | 
			
		||||
	return markup.IsMarkupFile(name, MarkupName)
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -74,28 +74,6 @@ func TestRender_StandardLinks(t *testing.T) {
 | 
			
		||||
		`<p><a href="`+lnkWiki+`" rel="nofollow">WikiPage</a></p>`)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func TestMisc_IsMarkdownFile(t *testing.T) {
 | 
			
		||||
	setting.Markdown.FileExtensions = []string{".md", ".markdown", ".mdown", ".mkd"}
 | 
			
		||||
	trueTestCases := []string{
 | 
			
		||||
		"test.md",
 | 
			
		||||
		"wow.MARKDOWN",
 | 
			
		||||
		"LOL.mDoWn",
 | 
			
		||||
	}
 | 
			
		||||
	falseTestCases := []string{
 | 
			
		||||
		"test",
 | 
			
		||||
		"abcdefg",
 | 
			
		||||
		"abcdefghijklmnopqrstuvwxyz",
 | 
			
		||||
		"test.md.test",
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	for _, testCase := range trueTestCases {
 | 
			
		||||
		assert.True(t, IsMarkdownFile(testCase))
 | 
			
		||||
	}
 | 
			
		||||
	for _, testCase := range falseTestCases {
 | 
			
		||||
		assert.False(t, IsMarkdownFile(testCase))
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func TestRender_Images(t *testing.T) {
 | 
			
		||||
	setting.AppURL = AppURL
 | 
			
		||||
	setting.AppSubURL = AppSubURL
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user