grim/hgwebplus

Parents 4bcf9895ae31
Children 60b7063b8f60
Use the markdown renderer for README.md, README.txt and README files. Fixes HGWEBPLUS-4
--- a/src/hgwebplus.py Sun Apr 12 02:42:09 2020 -0500
+++ b/src/hgwebplus.py Mon May 04 23:01:50 2020 -0500
@@ -265,12 +265,11 @@
# the ability to fallback if the prioritized one failed to render.
for filename in ctx:
lower = filename.lower()
- if lower == b'readme.md':
+ if lower in [b'readme.txt', b'readme', b'readme.md']:
raw_utf8 = ctx[filename].data().decode('utf-8')
return cmarkgfm.markdown_to_html(raw_utf8).encode('utf-8')
- if lower in [b'readme.txt', b'readme', b'readme.md']:
- return ctx[filename].data().replace(b'\n', b'<br/>\n')
+ return ""
def repo_custom_templater(orig, self, req):