From 7bf4feb5034c23bd3868514ae2f08e061f93d91d Mon Sep 17 00:00:00 2001 From: Lubomír Sedlář Date: Mar 11 2016 08:49:11 +0000 Subject: Render files with .markdown extension --- diff --git a/pagure/doc_utils.py b/pagure/doc_utils.py index a707d36..7423dde 100644 --- a/pagure/doc_utils.py +++ b/pagure/doc_utils.py @@ -98,7 +98,7 @@ def convert_readme(content, ext, view_file_url=None): if ext and ext in ['.rst']: safe = True output = convert_doc(content.decode('utf-8'), view_file_url) - elif ext and ext in ['.mk', '.md']: + elif ext and ext in ['.mk', '.md', '.markdown']: output = markdown.markdown(content.decode('utf-8')) safe = True elif not ext or (ext and ext in ['.text', '.txt']): diff --git a/pagure/ui/repo.py b/pagure/ui/repo.py index 149a7d8..f85769a 100644 --- a/pagure/ui/repo.py +++ b/pagure/ui/repo.py @@ -433,7 +433,7 @@ def view_file(repo, identifier, filename, username=None): 'Failed to load image %s, error: %s', filename, err ) output_type = 'binary' - elif ext in ('.rst', '.mk', '.md') and not rawtext: + elif ext in ('.rst', '.mk', '.md', '.markdown') and not rawtext: content, safe = pagure.doc_utils.convert_readme(content.data, ext) output_type = 'markup' elif not is_binary_string(content.data):