import re


def fenced_bootstrap(block):
    """Set up a fenced block for bootstrap prettify highlighting."""
    pattern = re.compile(r'```(?P<lang>\w+)?(?P<code>.*?)```', re.MULTILINE|re.DOTALL)
    match = pattern.match(block)
    if not match:
        return block
    lang = match.groupdict().get('lang', None)
    code = match.groupdict().get('code', '')
    return '''<pre class="prettyprint linenums">%s</pre>''' % code