aboutsummaryrefslogtreecommitdiffstats
path: root/filters
diff options
context:
space:
mode:
Diffstat (limited to 'filters')
-rwxr-xr-xfilters/syntax-highlighting.py6
-rwxr-xr-xfilters/syntax-highlighting.sh2
2 files changed, 4 insertions, 4 deletions
diff --git a/filters/syntax-highlighting.py b/filters/syntax-highlighting.py
index 1ca4108..e912594 100755
--- a/filters/syntax-highlighting.py
+++ b/filters/syntax-highlighting.py
@@ -30,11 +30,11 @@ 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')
+formatter = HtmlFormatter(style='pastie', nobackground=True)
try:
lexer = guess_lexer_for_filename(filename, data)
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.