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

jekyll-import: clear md from html

parent caf81e4a
Branches
No related tags found
2 merge requests!487Release,!483jekyll import: html tags in MD
Pipeline #7870 passed
...@@ -14,6 +14,7 @@ from typing import List ...@@ -14,6 +14,7 @@ from typing import List
from urllib.error import HTTPError from urllib.error import HTTPError
from uuid import uuid4 from uuid import uuid4
import bleach
import markdown.serializers import markdown.serializers
import yaml import yaml
from django.core.files.images import ImageFile from django.core.files.images import ImageFile
...@@ -571,7 +572,8 @@ class JekyllArticleImporter: ...@@ -571,7 +572,8 @@ class JekyllArticleImporter:
except (Page.DoesNotExist, Page.MultipleObjectsReturned): except (Page.DoesNotExist, Page.MultipleObjectsReturned):
article = self.page_model() article = self.page_model()
md = r[2] 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) html = html_md.convert(md)
article.perex = self.get_perex(md) or "..." article.perex = self.get_perex(md) or "..."
self.handle_content(article, meta, html) 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