Skip to content

Commit 775d2ab

Browse files
authored
Fixing bug: Unsafe HTML constructed from library input (#3312)
1 parent f6eba40 commit 775d2ab

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/playground/src/index.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,10 @@ export const setupPlayground = (
284284

285285
// Set up the label for the dropdown
286286
const versionButton = document.querySelectorAll("#versions > a").item(0)
287-
versionButton.innerHTML = "v" + sandbox.ts.version + " <span class='caret'/>"
287+
versionButton.textContent = "v" + sandbox.ts.version + " "
288+
const caret = document.createElement("spam")
289+
caret.classList.add("caret")
290+
versionButton.appendChild(caret)
288291
versionButton.setAttribute("aria-label", `Select version of TypeScript, currently ${sandbox.ts.version}`)
289292

290293
// Add the versions to the dropdown

0 commit comments

Comments
 (0)