From 5564a5d06678b3f9b0725bc4b2383ea1b7eb5515 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Sun, 22 Jan 2017 12:44:44 +0100 Subject: syntax-highlighting: replace invalid unicode with ? --- filters/syntax-highlighting.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'filters') diff --git a/filters/syntax-highlighting.py b/filters/syntax-highlighting.py index 1ca4108..5888b50 100755 --- a/filters/syntax-highlighting.py +++ b/filters/syntax-highlighting.py @@ -30,8 +30,8 @@ from pygments.lexers import guess_lexer_for_filename from pygments.formatters import HtmlFormatter -sys.stdin = io.TextIOWrapper(sys.stdin.buffer, encoding='utf-8') -sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8') +sys.stdin = io.TextIOWrapper(sys.stdin.buffer, encoding='utf-8', errors='replace') +sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8', errors='replace') data = sys.stdin.read() filename = sys.argv[1] formatter = HtmlFormatter(style='pastie') -- cgit v1.2.3-24-g4f1b From 67d0f870506e3bc3703ae3cb2cb00e19691ce967 Mon Sep 17 00:00:00 2001 From: Ville Skyttä Date: Sat, 14 Oct 2017 22:05:51 +0300 Subject: global: spelling fixes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Ville Skyttä --- filters/syntax-highlighting.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'filters') diff --git a/filters/syntax-highlighting.sh b/filters/syntax-highlighting.sh index 4fa7928..840bc34 100755 --- a/filters/syntax-highlighting.sh +++ b/filters/syntax-highlighting.sh @@ -1,6 +1,6 @@ #!/bin/sh # This script can be used to implement syntax highlighting in the cgit -# tree-view by refering to this file with the source-filter or repo.source- +# tree-view by referring to this file with the source-filter or repo.source- # filter options in cgitrc. # # This script requires a shell supporting the ${var##pattern} syntax. -- cgit v1.2.3-24-g4f1b From dbaee2672be14374acb17266477c19294c6155f3 Mon Sep 17 00:00:00 2001 From: Jeff Smith Date: Sat, 28 Oct 2017 21:43:26 -0500 Subject: ui-blame: Allow syntax highlighting Place file contents into a single block so that syntax highlighting can be applied in the usual fashion. Place the alternating color bars behind the file contents. Force the default syntax highlighting background to transparent. Signed-off-by: Jeff Smith Reviewed-by: John Keeping --- filters/syntax-highlighting.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'filters') diff --git a/filters/syntax-highlighting.py b/filters/syntax-highlighting.py index 5888b50..e912594 100755 --- a/filters/syntax-highlighting.py +++ b/filters/syntax-highlighting.py @@ -34,7 +34,7 @@ sys.stdin = io.TextIOWrapper(sys.stdin.buffer, encoding='utf-8', errors='replace sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8', errors='replace') data = sys.stdin.read() filename = sys.argv[1] -formatter = HtmlFormatter(style='pastie') +formatter = HtmlFormatter(style='pastie', nobackground=True) try: lexer = guess_lexer_for_filename(filename, data) -- cgit v1.2.3-24-g4f1b