def format_mentions(text, format_callback=format_mention):
def handle_mention(match):<EOL><INDENT>name, url = match.groups()<EOL>return format_callback(name, url)<EOL><DEDENT>return mention_re.sub(handle_mention, text)<EOL>
Searches the given text for mentions generated by `expand_mention()` and returns a human-readable form.

    For example:
    "@<bob http://example.org/twtxt.txt>" will result in "@bob"

    If you follow a source: source.nick will be bold
    If you are the mentioned source: source.nick will be bold and coloured
    If nothing from the above is true: nick will be unstyled
    If nothing from the above is true and nick is not given: url will be used