Spaces:
Running
on
Zero
Running
on
Zero
Update utils.py
Browse files
utils.py
CHANGED
@@ -232,9 +232,9 @@ def extract_parameters(input_string):
|
|
232 |
parameters['height'] = height
|
233 |
|
234 |
# Extracting other parameters
|
235 |
-
other_parameters = re.findall(r'(
|
236 |
for param in other_parameters:
|
237 |
-
parameters[param[0]] = param[1].strip('"')
|
238 |
|
239 |
return parameters
|
240 |
|
@@ -419,3 +419,8 @@ def html_template_message(msg):
|
|
419 |
</div>
|
420 |
</div>
|
421 |
"""
|
|
|
|
|
|
|
|
|
|
|
|
232 |
parameters['height'] = height
|
233 |
|
234 |
# Extracting other parameters
|
235 |
+
other_parameters = re.findall(r'([^,:]+): (.*?)(?=, [^,:]+:|$)', input_string)
|
236 |
for param in other_parameters:
|
237 |
+
parameters[param[0].strip()] = param[1].strip('"')
|
238 |
|
239 |
return parameters
|
240 |
|
|
|
419 |
</div>
|
420 |
</div>
|
421 |
"""
|
422 |
+
|
423 |
+
|
424 |
+
def escape_html(text):
|
425 |
+
"""Escapes HTML special characters in the input text."""
|
426 |
+
return text.replace("<", "<").replace(">", ">").replace("\n", "<br>")
|