Skip to content
Snippets Groups Projects
Commit 404070b2 authored by OndraRehounek's avatar OndraRehounek Committed by jan.bednarik
Browse files

fix blockquote and tags display in admin

parent 8721c410
No related branches found
No related tags found
2 merge requests!518Release,!516fix blockquote and tags display in admin
Pipeline #8235 canceled
......@@ -517,6 +517,7 @@ class JekyllArticleImporter:
return meta_dict
def handle_tags(self, article, meta):
article.tags.clear()
tags = meta.get("tags", []) or [] # někdy jsou tags None
if type(tags) == str: # někdy jsou tags str
......@@ -537,7 +538,8 @@ class JekyllArticleImporter:
msg = "Nelze importovat tag"
logger.warning(msg, extra={"tag": tag_name})
self.page_log += "{} - {}\n".format(msg, tag_name)
return None
article.save_revision()
def import_post(self, file_path):
......@@ -573,8 +575,10 @@ class JekyllArticleImporter:
article = self.page_model()
md = r[2] # "raw" markdown z postu
md = bleach.clean(md) # očistíme o případné nechtěné HTML tagy
html = html_md.convert(md)
# očistíme o případné nechtěné HTML tagy
html = bleach.clean(html, tags=bleach.sanitizer.ALLOWED_TAGS + ["div", "p"])
article.perex = self.get_perex(md) or "..."
self.handle_content(article, meta, html)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment