Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
if self.link and self.link in self.links:
output = "%s%s\n" % (output, self.links[self.link].markdownify(summary=True))
urls = utils.extract_urls(initial_message)
for u in urls:
if not u==self.link and u in self.links:
output = "%s%s\n" % (output, self.links[u].markdownify(summary=True))
output = "%s\n" % output
for c in self.comments:
output = "%s**%s:**\n%s\n\n" % (output, c.user.name, mdl(c.message))
self.save_markdown(output, save_location=save_location)
#
users_str = ' - '.join([self.users[k].name for k in self.users])
if not save_location:
title = initial_message if initial_message else self.link if hasattr(self, 'link') and self.link else 'no title available'
title = utils.truncate(re.sub('[\r\n]', ' / ', title), 180)
files.save_txt(title, subdir=self.id, filename="title.txt")
# output = "%s\n%s" % (output, self.links[k].markdownify(summary=True, prefer_snapshot=True))
output = "%s\n\n" % output
output = "%sPosts\n-----\n" % output
# show all posts
back_link = "[< back to %s](%s)" % (self.name, "/group/"+self.id)
for k in self.posts:
self.posts[k].markdownify(save_location=os.path.join(path, "%s.md" % k), back_link=back_link)
output = "%s* [%s](%s)\n" % (output, self.posts[k].get_shorty(), "/group/%s/post/%s" %(self.id, k))
output = "%s\n\n" % output
output = "%sContributors\n------------\n" % output
# show all posts
for k in self.users:
output = "%s* %s\n" % (output, self.users[k].name)
# save
self.save_markdown(output)
files.save_txt(self.name, subdir=self.id, filename="title.txt")
def save_markdown(self, md, save_location=None):
files.save_txt(md, subdir=self.id, save_location=save_location)