renderBlock :: PrettyPrintOptions -> Block -> IO Text.Lazy.Text
renderBlock opts@PrettyPrintOptions{..} b@(CodeBlock (CodeAttr lang _) t)
    | lang /= "haskell" && prettyPrintHasPygments = do
          mlexer <- getLexerByName (Text.unpack lang)
          case mlexer of
              Nothing -> return (renderBlockPure opts b)
              Just lexer -> do
                  let st = Text.unpack t
                  highlighted <- highlight lexer terminalFormatter [] st
                  return $ mconcatMapF ((<> "\n") . ("    " <>) . Text.Lazy.pack)
                                       (lines highlighted)
renderBlock :: PrettyPrintOptions -> Block -> IO Text.Lazy.Text
renderBlock opts@PrettyPrintOptions{..} b@(CodeBlock (CodeAttr lang _) t)
    | lang /= "haskell" && prettyPrintHasPygments = do
          mlexer <- getLexerByName (Text.unpack lang)
          case mlexer of
              Nothing -> return (renderBlockPure opts b)
              Just lexer -> do
                  let st = Text.unpack t
                  highlighted <- highlight lexer terminalFormatter [] st
                  return $ mconcatMapF ((<> "\n") . ("    " <>) . Text.Lazy.pack)
                                       (lines highlighted)
renderBlock opts@PrettyPrintOptions{..} b@(CodeBlock (CodeAttr lang _) t)
    | lang /= "haskell" && prettyPrintHasPygments = do
          mlexer <- getLexerByName (Text.unpack lang)
          case mlexer of
              Nothing -> return (renderBlockPure opts b)
              Just lexer -> do
                  let st = Text.unpack t
                  highlighted <- highlight lexer terminalFormatter [] st
                  return $ mconcatMapF ((<> "\n") . ("    " <>) . Text.Lazy.pack)
                                       (lines highlighted)