Fixing autolinks
When checking a links href and text for equality, first un-escape the underscores in the text -- because six escapes them. This should fix #29.
This commit is contained in:
@@ -131,7 +131,8 @@ class MarkdownConverter(object):
|
||||
return text
|
||||
href = el.get('href')
|
||||
title = el.get('title')
|
||||
if self.options['autolinks'] and text == href and not title:
|
||||
# For the replacement see #29: text nodes underscores are escaped
|
||||
if self.options['autolinks'] and text.replace(r'\_', '_') == href and not title:
|
||||
# Shortcut syntax
|
||||
return '<%s>' % href
|
||||
title_part = ' "%s"' % title.replace('"', r'\"') if title else ''
|
||||
|
||||
Reference in New Issue
Block a user