X-Git-Url: https://git.cameronkatri.com/cgit.git/blobdiff_plain/d3756bd7b00f9ad6adede3c7f956a25b22a2254a..bd1b281478c8d8ab45f723ac5818d58da4a64dd1:/filters/syntax-highlighting.py 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)