aboutsummaryrefslogtreecommitdiffstats
path: root/filters/syntax-highlighting.py
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2018-03-22 11:32:53 +0100
committerFlorian Pritz <bluewind@xinu.at>2018-03-22 11:32:53 +0100
commit343a8b8ee33f9a181e662fc0e3a3979dd9b52dd4 (patch)
tree2be5d6faa22089f8d1b0c1d7e14f283550130370 /filters/syntax-highlighting.py
parente4803632f41cc3f09af6a88511b1d6359be3d325 (diff)
parent33414d7869aa55aaccd45cdb82268d454cb79863 (diff)
downloadcgit-343a8b8ee33f9a181e662fc0e3a3979dd9b52dd4.tar.gz
cgit-343a8b8ee33f9a181e662fc0e3a3979dd9b52dd4.tar.xz
Merge branch 'master' of https://git.zx2c4.com/cgit into local
Diffstat (limited to 'filters/syntax-highlighting.py')
-rwxr-xr-xfilters/syntax-highlighting.py6
1 files changed, 3 insertions, 3 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)