diff options
author | Alex Xu (Hello71) <alex_y_xu@yahoo.ca> | 2020-03-08 22:36:18 -0400 |
---|---|---|
committer | Alex Xu (Hello71) <alex_y_xu@yahoo.ca> | 2020-03-08 22:36:18 -0400 |
commit | 503c7f30274fc4bb8b7719df56750a36c9b81ced (patch) | |
tree | fc5eab614b9e261e7203e2859b8392553e01ae8e | |
parent | f49c9e7c333199ca762719793b6cb626fc856edf (diff) | |
download | cgit-syntax-highlighting-503c7f30274fc4bb8b7719df56750a36c9b81ced.tar.xz cgit-syntax-highlighting-503c7f30274fc4bb8b7719df56750a36c9b81ced.zip |
add lexer info
-rwxr-xr-x | syntax-highlighting-server.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/syntax-highlighting-server.py b/syntax-highlighting-server.py index 05140a7..89377c1 100755 --- a/syntax-highlighting-server.py +++ b/syntax-highlighting-server.py @@ -69,6 +69,8 @@ class HighlightingHandler(BaseHTTPRequestHandler): lexer = guess_lexer(data) except ClassNotFound: lexer = TextLexer() + self.wfile.write('<!-- Lexer: ' + lexer.name + + ' (' + lexer.__class__.__name__ + ') -->') self.wfile.write(self.server.style_defs) highlight(data, lexer, self.server.formatter, outfile=self.wfile) |