添加mathjax

This commit is contained in:
Meekdai 2023-12-20 22:03:10 +08:00
parent 3587c22378
commit f1a94cada3

View File

@ -1,5 +1,6 @@
# -*- coding: utf-8 -*-
import os
import re
import json
import time
import datetime
@ -94,6 +95,11 @@ class GMEEK():
post_body=self.markdown2html(f.read())
f.close()
if '<math-renderer' in post_body:
post_body=re.sub(r'<math-renderer.*?>','',post_body)
post_body=re.sub(r'</math-renderer>','',post_body)
self.blogBase["script"]=self.blogBase["script"]+'<script async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>'
postBase=self.blogBase.copy()
postBase["postTitle"]=issue["postTitle"]
postBase["postBody"]=post_body