c49ba42e5f0e

Fix render of nested folders
[view raw] [browse files]
author theaspect@gmail.com
date Mon, 13 May 2013 21:22:16 +0700
parents 9ebbaae19100
children c90dd6006009 68c3007cd59d
branches/tags (none)
files __init__.py

Changes

--- a/__init__.py	Mon May 13 19:13:41 2013 +0700
+++ b/__init__.py	Mon May 13 21:22:16 2013 +0700
@@ -65,6 +65,9 @@
 	f = req.form.get('file', [''])[0]
 	parts = os.path.splitext(f)
 
+	if not parts[-1] == '.markdown' and not parts[-1] == '.md':
+		return orig(web, req, tmpl)
+
 	try:
 		fctx = webutil.filectx(web.repo, req)
 		text = fctx.data().decode("utf-8")
@@ -77,9 +80,6 @@
 	if util.binary(text):
 		return webcommands.rawfile(web, req, tmpl)
 
-	if not parts[1] == '.markdown' and not parts[1] == '.md':
-		return orig(web, req, tmpl)
-
 	md = markdown.Markdown(extensions=['wikilinks(base_url={0},end_url={1})'.format('', parts[1])])
 	html = md.convert(text).encode("utf-8")