Spaces:
Sleeping
Sleeping
escape chars fix
Browse files- src/streamlit_app.py +4 -3
src/streamlit_app.py
CHANGED
|
@@ -64,8 +64,8 @@ CATEGORIES = ["movies", "groceries"]
|
|
| 64 |
# ---------------------------------------------------------------------------
|
| 65 |
# Prolific config
|
| 66 |
# ---------------------------------------------------------------------------
|
| 67 |
-
PROLIFIC_COMPLETION_URL = "https://app.prolific.com/submissions/complete?cc=
|
| 68 |
-
PROLIFIC_COMPLETION_CODE = "
|
| 69 |
|
| 70 |
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
|
| 71 |
DATA_DIR = os.path.join(BASE_DIR, "data")
|
|
@@ -805,7 +805,8 @@ def inject_css():
|
|
| 805 |
# HTML escaping
|
| 806 |
# ---------------------------------------------------------------------------
|
| 807 |
def _safe(text: str) -> str:
|
| 808 |
-
|
|
|
|
| 809 |
for ch in ['*', '_', '~', '`', '[', ']']:
|
| 810 |
escaped = escaped.replace(ch, f'&#{ord(ch)};')
|
| 811 |
escaped = escaped.replace('\n', ' ')
|
|
|
|
| 64 |
# ---------------------------------------------------------------------------
|
| 65 |
# Prolific config
|
| 66 |
# ---------------------------------------------------------------------------
|
| 67 |
+
PROLIFIC_COMPLETION_URL = "https://app.prolific.com/submissions/complete?cc=C1JEJWOQ"
|
| 68 |
+
PROLIFIC_COMPLETION_CODE = "C1JEJWOQ"
|
| 69 |
|
| 70 |
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
|
| 71 |
DATA_DIR = os.path.join(BASE_DIR, "data")
|
|
|
|
| 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)};')
|
| 812 |
escaped = escaped.replace('\n', ' ')
|