diff options
author | Florian Pritz <bluewind@xinu.at> | 2018-03-22 11:32:53 +0100 |
---|---|---|
committer | Florian Pritz <bluewind@xinu.at> | 2018-03-22 11:32:53 +0100 |
commit | 343a8b8ee33f9a181e662fc0e3a3979dd9b52dd4 (patch) | |
tree | 2be5d6faa22089f8d1b0c1d7e14f283550130370 /filters | |
parent | e4803632f41cc3f09af6a88511b1d6359be3d325 (diff) | |
parent | 33414d7869aa55aaccd45cdb82268d454cb79863 (diff) | |
download | cgit-343a8b8ee33f9a181e662fc0e3a3979dd9b52dd4.tar.gz cgit-343a8b8ee33f9a181e662fc0e3a3979dd9b52dd4.tar.xz |
Merge branch 'master' of https://git.zx2c4.com/cgit into local
Diffstat (limited to 'filters')
-rwxr-xr-x | filters/syntax-highlighting.py | 6 | ||||
-rwxr-xr-x | filters/syntax-highlighting.sh | 2 |
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. |