perf: markdown render perf

This commit is contained in:
Soulter
2023-06-10 10:03:03 +00:00
parent 8e4a72c97b
commit ae732c1dac

View File

@@ -214,7 +214,7 @@ def render_markdown(markdown_text, image_width=800, image_height=600, font_size=
if font.getsize(line)[0] > image_width:
cp = line
for ii in range(len(line)):
if ii % max_width == 0:
if ii % image_width == 0:
cp = cp[:ii] + '\n' + cp[ii:]
pre_lines[i] = cp
cnt+=1