gstaff commited on
Commit
51b226c
·
1 Parent(s): 6caea81

Fix multiline Text field parsing.

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -183,7 +183,7 @@ def format_html(text, image_data):
183
  pattern = re.compile('Rarity: (.*)')
184
  rarity = pattern.findall(text)[0]
185
  template = template.replace("{rarity}", f"ss-{rarity}")
186
- pattern = re.compile(r'Text: (.*?)\n^.+:', re.MULTILINE | re.DOTALL)
187
  card_text = pattern.findall(text)[0]
188
  text_lines = []
189
  for line in card_text.splitlines():
 
183
  pattern = re.compile('Rarity: (.*)')
184
  rarity = pattern.findall(text)[0]
185
  template = template.replace("{rarity}", f"ss-{rarity}")
186
+ pattern = re.compile(r'^Text: (.*)\n\bFlavor.?Text|Power|Color\b', re.MULTILINE | re.DOTALL)
187
  card_text = pattern.findall(text)[0]
188
  text_lines = []
189
  for line in card_text.splitlines():