优化IO问题
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import subprocess
|
||||
import time
|
||||
|
||||
import markdown
|
||||
from playwright.async_api import async_playwright
|
||||
@@ -235,7 +236,8 @@ async def convert_md_str_to_image(md_content, output_image):
|
||||
"""
|
||||
将 Markdown 字符串转换为图片(异步)。
|
||||
"""
|
||||
temp_html = 'temp_output.html'
|
||||
timestamp = int(time.time())
|
||||
temp_html = f"temp_output_{timestamp}.html"
|
||||
md_str_to_html(md_content, temp_html)
|
||||
await html_to_image(temp_html, output_image)
|
||||
os.remove(temp_html)
|
||||
|
||||
Reference in New Issue
Block a user