From 60d8f86cff2c195f328896ab905d8b42b2bdd83b Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Feb 24 2017 08:45:36 +0000 Subject: Be a little more selective about the markdown extensions always activated In this commit we remove the abbr, footnotes and toc extensions from comment and commit message while we keep them for README files. This will speed up a little converting to markdown some of the comment --- diff --git a/pagure/lib/__init__.py b/pagure/lib/__init__.py index 4089f7f..c847011 100644 --- a/pagure/lib/__init__.py +++ b/pagure/lib/__init__.py @@ -3271,20 +3271,23 @@ def text2markdown(text, extended=True, readme=False): """ Simple text to html converter using the markdown library. """ extensions = [ - 'markdown.extensions.abbr', 'markdown.extensions.def_list', 'markdown.extensions.fenced_code', - 'markdown.extensions.footnotes', 'markdown.extensions.tables', 'markdown.extensions.smart_strong', # All of the above are the .extra extensions - the attribute lists one 'markdown.extensions.admonition', 'markdown.extensions.codehilite', 'markdown.extensions.sane_lists', - 'markdown.extensions.toc', ] # Some extensions are disabled for READMEs and enabled otherwise - if not readme: + if readme: + extensions.append( + 'markdown.extensions.abbr', + 'markdown.extensions.footnotes', + 'markdown.extensions.toc', + ) + else: extensions.append( 'markdown.extensions.nl2br', )