Spaces:
Running
Running
Anonymous commited on
Commit ·
dc40f4d
1
Parent(s): 30db9ab
Trim trailing punctuation from context cues
Browse files- index.html +2 -1
index.html
CHANGED
|
@@ -120,7 +120,8 @@
|
|
| 120 |
const turn = document.createElement("p");
|
| 121 |
const speaker = speakers[index];
|
| 122 |
const context = contexts[index];
|
| 123 |
-
const
|
|
|
|
| 124 |
const escapedText = escapeHtml(text);
|
| 125 |
if (speaker !== undefined && speaker !== "") {
|
| 126 |
turn.innerHTML = `<strong>[S${Number(speaker) + 1}]</strong> ${escapedText}${contextBadge}`;
|
|
|
|
| 120 |
const turn = document.createElement("p");
|
| 121 |
const speaker = speakers[index];
|
| 122 |
const context = contexts[index];
|
| 123 |
+
const cleanContext = context ? String(context).replace(/[,,。.!!??;;::、\s]+$/u, "") : "";
|
| 124 |
+
const contextBadge = cleanContext ? ` <span class="context-cue">${escapeHtml(cleanContext)}</span>` : "";
|
| 125 |
const escapedText = escapeHtml(text);
|
| 126 |
if (speaker !== undefined && speaker !== "") {
|
| 127 |
turn.innerHTML = `<strong>[S${Number(speaker) + 1}]</strong> ${escapedText}${contextBadge}`;
|