From ea32116c274c1c3293136c0f7a3430e7acc8e544 Mon Sep 17 00:00:00 2001 From: Igor Chubin Date: Mon, 29 May 2017 19:35:08 +0000 Subject: [PATCH] ignore unkown color styles + :styles-demo --- lib/cheat_wrapper.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/cheat_wrapper.py b/lib/cheat_wrapper.py index a477354..8c77937 100644 --- a/lib/cheat_wrapper.py +++ b/lib/cheat_wrapper.py @@ -35,7 +35,7 @@ from buttons import TWITTER_BUTTON, GITHUB_BUTTON, GITHUB_BUTTON_2, GITHUB_BUTTO from adapter_learnxiny import get_learnxiny, get_learnxiny_list, is_valid_learnxy # globals -INTERNAL_TOPICS = [":firstpage", ':post', ':bash_completion', ':help', ':styles'] +INTERNAL_TOPICS = [":firstpage", ':post', ':bash_completion', ':help', ':styles', ':styles-demo'] LEXER = { "go" : GoLexer, "scala" : ScalaLexer, @@ -463,6 +463,8 @@ def cheat_wrapper(query, request_options=None, html=False): highlight = not bool(request_options and request_options.get('no-terminal')) color_style = request_options.get('style', '') + if color_style not in COLOR_STYLES: + color_style = '' keyword = None if '~' in query: