(self, m)
return el
Handle URL matches.
Handle URL matches.
Handle URL matches .
def handleMatch(self, m):
        """Handle URL matches."""

        shorten = self.config.get('repo_url_shortener', False)
        el = md_util.etree.Element("a")
        el.text = md_util.AtomicString(m.group(2))
        if m.group("www"):
            href = "http://%s" % m.group(2)
        else:
            href = m.group(2)
            if self.config['hide_protocol']:
                el.text = md_util.AtomicString(el.text[el.text.find("://") + 3:])

        if shorten:
            el.set('magiclink', '1')
        el.set("href", self.sanitize_url(self.unescape(href.strip())))
        return el
def handleMatch ( self , m ) : shorten = self . config . get ( 'repo_url_shortener' , False ) el = md_util . etree . Element ( "a" ) el . text = md_util . AtomicString ( m . group ( 2 ) ) if m . group ( "www" ) : href = "http://%s" % m . group ( 2 ) else : href = m . group ( 2 ) if self . config [ 'hide_protocol' ] : el . text = md_util . AtomicString ( el . text [ el . text . find ( "://" ) + 3 : ] ) if shorten : el . set ( 'magiclink' , '1' ) el . set ( "href" , self . sanitize_url ( self . unescape ( href . strip ( ) ) ) ) return el