Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
:returns: A list of urwid Widgets or a single urwid Widget
"""
headings = config.STYLE["headings"]
level = token["level"]
style = config.STYLE["headings"].get(str(level), headings["default"])
prefix = styled_text(style["prefix"], style)
suffix = styled_text(style["suffix"], style)
rendered = render_text(text=token["text"])
styled_rendered = styled_text(rendered, style, supplement_style=True)
return [
urwid.Divider(),
ClickableText([prefix] + styled_text(rendered, style) + [suffix]),
urwid.Divider(),
]
Many other functions call this function directly, passing in the extra
``text`` argument and leaving all other arguments blank.
See :any:`lookatme.tui.SlideRenderer.do_render` for additional argument and
return value descriptions.
"""
if text is None:
text = token["text"]
inline_lexer = mistune.InlineLexer(markdown_inline_renderer)
res = inline_lexer.output(text)
if len(res) == 0:
res = [""]
return ClickableText(res)
def header_modifier(cell):
return ClickableText(styled_text(cell, "bold"), align=cell.align)