aboutsummaryrefslogtreecommitdiffstats
path: root/filters
diff options
context:
space:
mode:
Diffstat (limited to 'filters')
-rwxr-xr-xfilters/syntax-highlighting.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/filters/syntax-highlighting.py b/filters/syntax-highlighting.py
index b5d615e..1ca4108 100755
--- a/filters/syntax-highlighting.py
+++ b/filters/syntax-highlighting.py
@@ -21,6 +21,7 @@
21 21
22 22
23import sys 23import sys
24import io
24from pygments import highlight 25from pygments import highlight
25from pygments.util import ClassNotFound 26from pygments.util import ClassNotFound
26from pygments.lexers import TextLexer 27from pygments.lexers import TextLexer
@@ -29,6 +30,8 @@ from pygments.lexers import guess_lexer_for_filename
29from pygments.formatters import HtmlFormatter 30from pygments.formatters import HtmlFormatter
30 31
31 32
33sys.stdin = io.TextIOWrapper(sys.stdin.buffer, encoding='utf-8')
34sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8')
32data = sys.stdin.read() 35data = sys.stdin.read()
33filename = sys.argv[1] 36filename = sys.argv[1]
34formatter = HtmlFormatter(style='pastie') 37formatter = HtmlFormatter(style='pastie')