ehejin commited on
Commit
63a62d2
·
1 Parent(s): cc86d97

add spaces in product display

Browse files
Files changed (1) hide show
  1. src/streamlit_app.py +3 -1
src/streamlit_app.py CHANGED
@@ -15,7 +15,7 @@ On HuggingFace Spaces, set these environment variables in Space Settings → Var
15
  DATASET_REPO_ID - HuggingFace dataset repo to upload results
16
  DEBUG_MODE - "true" to skip validation (optional)
17
  """
18
-
19
  import csv
20
  import html as html_lib
21
  import json
@@ -804,8 +804,10 @@ def inject_css():
804
  # ---------------------------------------------------------------------------
805
  # HTML escaping
806
  # ---------------------------------------------------------------------------
 
807
  def _safe(text: str) -> str:
808
  unescaped = html_lib.unescape(str(text))
 
809
  escaped = html_lib.escape(unescaped)
810
  for ch in ['*', '_', '~', '`', '[', ']']:
811
  escaped = escaped.replace(ch, f'&#{ord(ch)};')
 
15
  DATASET_REPO_ID - HuggingFace dataset repo to upload results
16
  DEBUG_MODE - "true" to skip validation (optional)
17
  """
18
+ import re
19
  import csv
20
  import html as html_lib
21
  import json
 
804
  # ---------------------------------------------------------------------------
805
  # HTML escaping
806
  # ---------------------------------------------------------------------------
807
+
808
  def _safe(text: str) -> str:
809
  unescaped = html_lib.unescape(str(text))
810
+ unescaped = re.sub(r'([.!?:])([A-Z])', r'\1 \2', unescaped)
811
  escaped = html_lib.escape(unescaped)
812
  for ch in ['*', '_', '~', '`', '[', ']']:
813
  escaped = escaped.replace(ch, f'&#{ord(ch)};')