How to use the mistune.scanner.escape_url function in mistune

To help you get started, we’ve selected a few mistune 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 lepture / mistune / mistune / toc.py View on Github external
def gen_toc_id(text):
    text = TAG.sub('', text)
    text = '-'.join(text.split()).strip('-')
    return escape_url(text.lower())
github lepture / mistune / mistune / inline_parser.py View on Github external
def tokenize_link(self, line, link, text, title, state):
        if state.get('_in_link'):
            return 'text', line
        state['_in_link'] = True
        text = self.render(text, state)
        state['_in_link'] = False
        return 'link', escape_url(link), text, title
github lepture / mistune / mistune / inline_parser.py View on Github external
def parse_auto_link(self, m, state):
        if state.get('_in_link'):
            return 'text', m.group(0)

        text = m.group(1)
        if '@' in text and not text.lower().startswith('mailto:'):
            link = 'mailto:' + text
        else:
            link = text
        return 'link', escape_url(link), text
github lepture / mistune / mistune / plugins / extra.py View on Github external
def parse_url_link(self, m, state):
    return 'link', escape_url(m.group(0))