Spaces:
Running
Running
Anonymous commited on
Commit ·
bcf9f5b
1
Parent(s): e67d3e6
Bold script context cues
Browse files- index.html +4 -3
index.html
CHANGED
|
@@ -120,11 +120,12 @@
|
|
| 120 |
const turn = document.createElement("p");
|
| 121 |
const speaker = speakers[index];
|
| 122 |
const context = contexts[index];
|
| 123 |
-
const
|
|
|
|
| 124 |
if (speaker !== undefined && speaker !== "") {
|
| 125 |
-
turn.innerHTML = `<strong>[S${Number(speaker) + 1}]</strong> ${
|
| 126 |
} else {
|
| 127 |
-
turn.
|
| 128 |
}
|
| 129 |
wrapper.appendChild(turn);
|
| 130 |
});
|
|
|
|
| 120 |
const turn = document.createElement("p");
|
| 121 |
const speaker = speakers[index];
|
| 122 |
const context = contexts[index];
|
| 123 |
+
const contextPrefix = context ? `<strong>(${escapeHtml(context)})</strong> ` : "";
|
| 124 |
+
const escapedText = escapeHtml(text);
|
| 125 |
if (speaker !== undefined && speaker !== "") {
|
| 126 |
+
turn.innerHTML = `<strong>[S${Number(speaker) + 1}]</strong> ${contextPrefix}${escapedText}`;
|
| 127 |
} else {
|
| 128 |
+
turn.innerHTML = `${contextPrefix}${escapedText}`;
|
| 129 |
}
|
| 130 |
wrapper.appendChild(turn);
|
| 131 |
});
|