How to use the ttp.ttp.URL_REGEX function in ttp

To help you get started, we’ve selected a few ttp examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ploneintranet / ploneintranet / src / ploneintranet / microblog / browser / utils.py View on Github external
def link_urls(text):
    """
    Enriches urls in the comment text with an anchor.
    """
    parser = ttp.Parser(max_url_length=40)
    parser._urls = []
    return ttp.URL_REGEX.sub(parser._parse_urls, text)