feat: added fenced code blocks
This commit is contained in:
parent
e3fe49bed7
commit
c33307e714
@ -2,7 +2,7 @@
|
||||
name = "stsg"
|
||||
dependencies = [
|
||||
"watchdog~=6.0.0",
|
||||
"markdown~=3.3.6",
|
||||
"markdown2~=2.5.3",
|
||||
"bs4~=0.0.2",
|
||||
"toml~=0.10.2",
|
||||
"jinja2~=3.1.6",
|
||||
|
@ -3,7 +3,7 @@ import logging
|
||||
import shutil
|
||||
from pathlib import Path
|
||||
import os
|
||||
import markdown
|
||||
from markdown2 import markdown
|
||||
from typing import Optional, Union, Dict, Generator, List, DefaultDict, Any, TypedDict, Set
|
||||
from bs4 import BeautifulSoup
|
||||
from collections import defaultdict
|
||||
@ -157,7 +157,7 @@ class ArticleTranslation:
|
||||
|
||||
self.html_content = self.file.read_text()
|
||||
if self.file.suffix == ".md":
|
||||
self.html_content = markdown.markdown(self.html_content)
|
||||
self.html_content = markdown(self.html_content, extras=["fenced-code-blocks"])
|
||||
|
||||
def __init_context__(self):
|
||||
self.context["meta"] = self.article.context_shared
|
||||
|
Loading…
x
Reference in New Issue
Block a user