summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xsyntax-highlighting-server.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/syntax-highlighting-server.py b/syntax-highlighting-server.py
index 48482cc..aa6c570 100755
--- a/syntax-highlighting-server.py
+++ b/syntax-highlighting-server.py
@@ -70,6 +70,9 @@ class HighlightingHandler(BaseHTTPRequestHandler):
except ClassNotFound:
try:
lexer = guess_lexer(data)
+ # SqlLexer always gives 0.01
+ if lexer.analyse_text(data) <= 0.01:
+ lexer = TextLexer()
except ClassNotFound:
lexer = TextLexer()
self.wfile.write(('<!-- Lexer: ' + lexer.name +