Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def codespan(text, old_styles):
res = pygments_render.render_text(" " + text + " ", plain=True)
return res
def render_code(token, body, stack, loop):
"""Renders a code block using the Pygments library.
See :any:`lookatme.tui.SlideRenderer.do_render` for additional argument and
return value descriptions.
"""
lang = token.get("lang", "text") or "text"
text = token["text"]
res = pygments_render.render_text(text, lang=lang)
return [
urwid.Divider(),
res,
urwid.Divider(),
]