def show_markup(text, spans, index=False): from IPython.display import HTML, display html = ''.join(format_markup(text, spans, index=index)) display(HTML(html))