From a3651eaef1c56d876843ab72079975d5131c4f01 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Sep 04 2017 09:52:29 +0000 Subject: Remove the line numbers coming from pygments on pull-requests Since we're adding there our own line numbers Signed-off-by: Pierre-Yves Chibon --- diff --git a/pagure/templates/pull_request.html b/pagure/templates/pull_request.html index a6f2891..d557964 100644 --- a/pagure/templates/pull_request.html +++ b/pagure/templates/pull_request.html @@ -489,7 +489,7 @@ {% else %} {% autoescape false %} - {{ patch | patch_to_diff | html_diff | format_loc( + {{ patch | patch_to_diff | html_diff(linenos=None) | format_loc( filename=patch_new_file_path, commit=patch_new_id, prequest=pull_request, diff --git a/pagure/ui/filters.py b/pagure/ui/filters.py index ae39f67..95d6fac 100644 --- a/pagure/ui/filters.py +++ b/pagure/ui/filters.py @@ -397,7 +397,7 @@ def markdown_filter(text): @APP.template_filter('html_diff') -def html_diff(diff): +def html_diff(diff, linenos='inline'): """Display diff as HTML""" if diff is None: return @@ -411,7 +411,7 @@ def html_diff(diff): diff, difflexer, HtmlFormatter( - linenos='inline', + linenos=linenos, noclasses=True, style="diffstyle") )