summaryrefslogtreecommitdiffstats
path: root/modules
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2017-05-02 16:57:54 +0800
committerBo-Yi Wu <appleboy.tw@gmail.com>2017-05-02 16:57:54 +0800
commit0d1e001b9cae08c2d5f0ffc0ef9fec0f92d1683e (patch)
tree7859dedd67c1848060c03ef3fdbdcdb76aa2070b /modules
parent98548c83d369a15f10dcd01656474c8dad98ba6a (diff)
downloadgitea-0d1e001b9cae08c2d5f0ffc0ef9fec0f92d1683e.tar.gz
gitea-0d1e001b9cae08c2d5f0ffc0ef9fec0f92d1683e.zip
fix multiple readme file rendering and fix #1657 (#1658)
* fix multiple readme file rendering and fix #1657 * remove unnecessary loop
Diffstat (limited to 'modules')
-rw-r--r--modules/markup/markup.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/modules/markup/markup.go b/modules/markup/markup.go
index 0847fcfb0d..dc27997e8d 100644
--- a/modules/markup/markup.go
+++ b/modules/markup/markup.go
@@ -59,6 +59,15 @@ func Type(filename string) string {
return ""
}
+// ReadmeFileType reports whether name looks like a README file
+// based on its name and find the parser via its ext name
+func ReadmeFileType(name string) (string, bool) {
+ if IsReadmeFile(name) {
+ return Type(name), true
+ }
+ return "", false
+}
+
// IsReadmeFile reports whether name looks like a README file
// based on its name.
func IsReadmeFile(name string) bool {