Spaces:
Runtime error
Runtime error
Fix multiline Text field parsing.
Browse files
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: (
|
| 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():
|