def styles_to_html(formatter, styles, condensed):
# type: (CodeFormatter, Iterable[Style], bool) -> str
equivalents = condense_option_values(formatter, styles, condensed)
styletexts = [formatter.styletext(s) for s in equivalents if s]
fragments = [cgi.escape(unistr(e)) for e in styletexts]
or_join = unistr("------------ or ------------\n").join
html = '<pre>' + or_join(fragments).replace('\n', '<br/>') + '</pre>'
return html
评论列表
文章目录