def _highlight(html):
formatter = pygments.formatters.HtmlFormatter(nowrap=True)<EOL>code_expr = re.compile(<EOL>r'<STR_LIT>'<EOL>r'<STR_LIT>', re.DOTALL)<EOL>def replacer(match):<EOL><INDENT>try:<EOL><INDENT>lang = match.group('<STR_LIT>')<EOL>lang = _LANG_ALIASES.get(lang, lang)<EOL>lexer = pygments.lexers.get_lexer_by_name(lang)<EOL><DEDENT>except ValueError:<EOL><INDENT>lexer = pygments.lexers.TextLexer()<EOL><DEDENT>code = match.group('<STR_LIT:code>')<EOL>code = html_parser.HTMLParser().unescape(code)<EOL>highlighted = pygments.highlight(code, lexer, formatter)<EOL>return '<STR_LIT>'.format(highlighted)<EOL><DEDENT>result = code_expr.sub(replacer, html)<EOL>return result<EOL>
Syntax-highlights HTML-rendered Markdown.

    Plucks sections to highlight that conform the the GitHub fenced code info
    string as defined at https://github.github.com/gfm/#info-string.

    Args:
        html (str): The rendered HTML.

    Returns:
        str: The HTML with Pygments syntax highlighting applied to all code
            blocks.