Anonymous commited on
Commit
bcf9f5b
·
1 Parent(s): e67d3e6

Bold script context cues

Browse files
Files changed (1) hide show
  1. 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 textWithContext = context ? `(${context}) ${text}` : text;
 
124
  if (speaker !== undefined && speaker !== "") {
125
- turn.innerHTML = `<strong>[S${Number(speaker) + 1}]</strong> ${escapeHtml(textWithContext)}`;
126
  } else {
127
- turn.textContent = textWithContext;
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
  });