improve source code comment plugin functionality

这个提交包含在:
binary-husky
2024-07-13 16:03:13 +00:00
父节点 c1b8c773c3
当前提交 ff899777ce
共有 8 个文件被更改,包括 29 次插入16 次删除

查看文件

@@ -285,6 +285,17 @@ class PythonCodeComment():
return code_block
else:
return code
def get_markdown_block_in_html(self, html):
from bs4 import BeautifulSoup
soup = BeautifulSoup(html, 'lxml')
found_list = soup.find_all("div", class_="markdown-body")
if found_list:
res = found_list[0]
return res.prettify()
else:
return None
def sync_and_patch(self, original, revised):
"""Ensure the number of pre-string empty lines in revised matches those in original."""