Remove entry in phantom_sets when markdown_view is closed

Otherwise the object would keep on growing forever. It probably would
never ever be a problem for anyone, but it just makes me feel better
This commit is contained in:
Mathieu PATUREL
2019-11-14 21:17:22 +11:00
parent cc28bfef96
commit 8c1012eb8c
4 changed files with 33 additions and 18 deletions

View File

@ -62,14 +62,16 @@ def markdown2html(markdown, basepath, re_render):
img_element['src'] = base64
# remove comments, because they pollute the console with error messages
for comment_element in soup.find_all(text=lambda text: isinstance(text, bs4.Comment)):
comment_element.extract()
# FIXME: how do tables look? should we use ascii tables?
# FIXME: pre aren't handled by ST3. The require manual adjustment
# FIXME: include a stylesheet
# FIXME: remove the comments, because they pollute the console with error messages
return str(soup)
def get_base64_image(path, re_render):