r3gm commited on
Commit
3463ce4
1 Parent(s): dd2108f

Update utils.py

Browse files
Files changed (1) hide show
  1. utils.py +7 -2
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'(\w+): (.*?)(?=, \w+|$)', input_string)
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("<", "&lt;").replace(">", "&gt;").replace("\n", "<br>")