Skip to content
Snippets Groups Projects
Commit 7759433b authored by jan.bednarik's avatar jan.bednarik
Browse files

Fix Jekyll import

parent b56555d5
Branches
No related tags found
2 merge requests!719Fix Jekyll import,!718Fix Jekyll import
Pipeline #11477 passed
......@@ -83,17 +83,17 @@ def download_repo_as_zip(url: str) -> (str, str):
# zdá se, že někdy je -gh-pages, někdy -master...
gh_pages_path = os.path.join(path, "{}-gh-pages".format(repo_name))
gh_pages_path_exists = os.path.exists(gh_pages_path)
master_path = os.path.join(path, "{}-master".format(repo_name))
master_path_exists = os.path.exists(master_path)
if gh_pages_path_exists:
if os.path.exists(gh_pages_path):
return gh_pages_path, repo_name
if master_path_exists:
master_path = os.path.join(path, "{}-master".format(repo_name))
if os.path.exists(master_path):
return master_path, repo_name
else:
main_path = os.path.join(path, "{}-main".format(repo_name))
if os.path.exists(main_path):
return main_path, repo_name
raise NotImplementedError("Tento zip nedokážeme zpracovat.")
......@@ -576,7 +576,9 @@ class JekyllArticleImporter:
md = r[2] # "raw" markdown z postu
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"])
html = bleach.clean(
html, tags=list(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