diff --git a/howdoi/howdoi.py b/howdoi/howdoi.py
index <HASH>..<HASH> 100644
--- a/howdoi/howdoi.py
+++ b/howdoi/howdoi.py
@@ -32,9 +32,7 @@ from cachelib import FileSystemCache, NullCache
 
 from keep import utils as keep_utils
 
-from pygments import highlight
 from pygments.lexers import guess_lexer, get_lexer_by_name
-from pygments.formatters.terminal import TerminalFormatter
 from pygments.util import ClassNotFound
 from rich.syntax import Syntax
 from rich.console import Console
@@ -333,13 +331,12 @@ def _format_output(args, code):
     # no lexer found above, use the guesser
     if not lexer:
         try:
-            lexer = guess_lexer(code)
+            lexer = guess_lexer(code).name
         except ClassNotFound:
             return code
 
-    return highlight(code,
-                     lexer,
-                     TerminalFormatter(bg='dark'))
+    syntax = Syntax(code, lexer, background_color="default", line_numbers=False)
+    return syntax
 
 
 def _is_question(link):
@@ -814,10 +811,8 @@ def command_line_runner():  # pylint: disable=too-many-return-statements,too-man
         args['color'] = True
 
     result = howdoi(args)
-    lang = guess_lexer(result).name
-    syntax = Syntax(result, lang, background_color="default", line_numbers=False)
     console = Console()
-    console.print(syntax)
+    console.print(result)
 
     # close the session to release connection
     howdoi_session.close()
replaced pygment's highlight with rich's syntax func