fix: preview html fuckup
This commit is contained in:
parent
afefce0a11
commit
8054a4a983
@ -47,8 +47,10 @@ class ArticleTranslation:
|
||||
self.language_code = self.file.stem
|
||||
|
||||
self.article_content = self.file.read_text()
|
||||
self.article_preview = self.article_content[:config.formatting.article_preview_length] + "..."
|
||||
if self.file.suffix == ".md":
|
||||
self.article_content = markdown.markdown(self.article_content)
|
||||
self.article_preview = markdown.markdown(self.article_preview)
|
||||
|
||||
self.location_in_tree = [self.language_code, *self.article_overview.location_in_tree]
|
||||
self.url = "/" + "/".join(self.location_in_tree)
|
||||
@ -79,7 +81,7 @@ class ArticleTranslation:
|
||||
def _get_values(self, return_foreign_articles: bool = True) -> Dict[str, str]:
|
||||
r = {
|
||||
"article_content": self.article_content,
|
||||
"article_preview": self.article_content[:config.formatting.article_preview_length] + "...",
|
||||
"article_preview": self.article_preview,
|
||||
"article_url": self.url,
|
||||
"article_overview_url": self.article_overview.url,
|
||||
"article_slug": self.article_overview.slug,
|
||||
|
Loading…
x
Reference in New Issue
Block a user