diff options
| author | altaf-creator <dev@altafcreator.com> | 2026-06-26 12:06:38 +0800 |
|---|---|---|
| committer | altaf-creator <dev@altafcreator.com> | 2026-06-26 12:06:38 +0800 |
| commit | 3abcae19fefd11bbfba6cbf696b342ea72da6992 (patch) | |
| tree | 37fe730ff6b1475ea24eb0f04df200ef923461c7 /markdown_renderer.py | |
| parent | 1b14996290f228a329d83c164e50c27364cc0a22 (diff) | |
Diffstat (limited to 'markdown_renderer.py')
| -rw-r--r-- | markdown_renderer.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/markdown_renderer.py b/markdown_renderer.py index 7c1bd0b..dd70df2 100644 --- a/markdown_renderer.py +++ b/markdown_renderer.py @@ -28,7 +28,7 @@ def md_to_html(raw_content: str, text_mode: bool = False) -> str: html_text = markdown.markdown( content, output_format="html", - extensions=["attr_list", "fenced_code", "tables", DefaultClassExtension(), "md_in_html", "pymdownx.tilde", "footnotes"] + extensions=["attr_list", "fenced_code", "tables", DefaultClassExtension(), "md_in_html", "pymdownx.tilde", "footnotes", "codehilite"] ) section_class = "" @@ -46,11 +46,14 @@ def md_to_html(raw_content: str, text_mode: bool = False) -> str: html_text = html_text.replace("<p>+=+=+=</p>", f'<section class="normal-section{section_class_only}"><div class="center-grid"><div class="div-sizing">') html_text = html_text.replace("<p>+=+=+=", f'<section class="normal-section{section_class_only}"><div class="center-grid"><div class="div-sizing">') html_text = html_text.replace("+=+=+=</p>", f'<section class="normal-section{section_class_only}"><div class="center-grid"><div class="div-sizing">') - html_text = html_text.replace("<p>{{{</p>", '<div class="flex-container gap">') - html_text = html_text.replace("<p>{{{", '<div class="flex-container gap">') - html_text = html_text.replace("{{{</p>", '<div class="flex-container gap">') + html_text = html_text.replace("<p>{{{</p>", '<div class="flex-container flex-container-dynamic gap-row">') + html_text = html_text.replace("<p>{{{", '<div class="flex-container flex-container-dynamic gap-row">') + html_text = html_text.replace("{{{</p>", '<div class="flex-container flex-container-dynamic gap-row">') html_text = html_text.replace("<p>}}}</p>", '</div>') html_text = html_text.replace("}}}</p>", '</div>') html_text = html_text.replace("<p>}}}", '</div>') + html_text = html_text.replace("<p>{&{</p>", '<div class="flex-container flex-container-dynamic gap">') + html_text = html_text.replace("<p>{&{", '<div class="flex-container flex-container-dynamic gap">') + html_text = html_text.replace("{&{</p>", '<div class="flex-container flex-container-dynamic gap">') return (metadata, html_text) |
