don't link non-link links

This commit is contained in:
MarkusRost 2020-08-01 21:22:49 +00:00
parent dcf5761c1f
commit 8649d470f0

View file

@ -448,13 +448,13 @@ class LinkParser(HTMLParser):
def handle_data(self, data):
if self.recent_href:
self.new_string = self.new_string + "[{}](<{}>)".format(data, self.recent_href)
self.new_string = self.new_string + "[{}](<{}>)".format(data.replace("//", "/\\/"), self.recent_href)
self.recent_href = ""
else:
self.new_string = self.new_string + data
self.new_string = self.new_string + data.replace("//", "/\\/")
def handle_comment(self, data):
self.new_string = self.new_string + data
self.new_string = self.new_string + data.replace("//", "/\\/")
def handle_endtag(self, tag):
misc_logger.debug(self.new_string)