Skip to content

Commit

Permalink
Update Gmeek.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Meekdai committed May 28, 2024
1 parent 88e434c commit a7e4e68
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions Gmeek.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
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 @@ -159,8 +158,11 @@ 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)
if '<code class="notranslate">Gmeek-html' in post_body:
pattern = r'<code class="notranslate">Gmeek-html>(.*?)</code>'
post_body=re.sub(pattern, r'\1', post_body)

<code class="notranslate">Gmeek-html<img src='https://picsum.photos/200'></code>

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

0 comments on commit a7e4e68

Please sign in to comment.