Skip to content

Commit

Permalink
Fix rendering disorder
Browse files Browse the repository at this point in the history
  • Loading branch information
heyrict committed Jun 11, 2018
1 parent a914832 commit 3c8ef3d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions imaging/puzzle_rendering.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import os
import markdown
import re

import markdown
from bs4 import BeautifulSoup
from PIL import Image, ImageDraw, ImageFont

Expand All @@ -17,7 +18,10 @@


def _split_lines(text, stop):
return [text[i:i + stop] for i in range(0, len(text), stop)]
text = re.split(r'\n+', text)
text = [[part[i:i + stop] for i in range(0, len(part), stop)]
for part in text if part]
return sum(text, [])


def render(title, content):
Expand Down

0 comments on commit 3c8ef3d

Please sign in to comment.