Skip to content

Commit

Permalink
添加文章页自定义html标签
Browse files Browse the repository at this point in the history
##{"html":""}##
  • Loading branch information
Meekdai committed May 28, 2024
1 parent be54540 commit 88e434c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Gmeek.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import urllib
import requests
import argparse
import html
from github import Github
from xpinyin import Pinyin
from feedgen.feed import FeedGenerator
Expand Down Expand Up @@ -158,6 +159,9 @@ def createPostHtml(self,issue):
f'color: var(--fgColor-{style},var(--color-{style}-fg));}}</style>'
)

if '##{"html":' in post_body:
post_body=re.sub(r'##\{"html":"(.*?)"\}##',lambda x: html.unescape(x.group(1)),post_body,flags=re.DOTALL)

postBase["postTitle"]=issue["postTitle"]
postBase["postUrl"]=self.blogBase["homeUrl"]+"/"+issue["postUrl"]
postBase["description"]=issue["description"]
Expand Down

0 comments on commit 88e434c

Please sign in to comment.