diff --git a/markdown.js b/markdown.js index 6c92953..78ff977 100644 --- a/markdown.js +++ b/markdown.js @@ -361,12 +361,12 @@ function embed(links) { embeddedElement.classList.add("scratch-embed"); const request = new XMLHttpRequest(); - request.open('GET', `https://trampoline.turbowarp.org/api/projects/${trackId}`); + request.open('GET', `https://trampoline.turbowarp.org/api/projects/${escapeHtml(trackId)}`); request.onload = () => { const data = JSON.parse(request.responseText); embeddedElement.innerHTML = ` -
-
${data.title}
+
+
${escapeHtml(data.title)}
` } request.send(); @@ -384,12 +384,12 @@ function embed(links) { embeddedElement.classList.add("scratch-embed"); const request = new XMLHttpRequest(); - request.open('GET', `https://trampoline.turbowarp.org/api/projects/${trackId}`); + request.open('GET', `https://trampoline.turbowarp.org/api/projects/${escapeHtml(trackId)}`); request.onload = () => { const data = JSON.parse(request.responseText); embeddedElement.innerHTML = ` -
-
${data.title}
+
+
${escapeHtml(data.title)}
` } request.send(); @@ -417,12 +417,12 @@ function embed(links) { post = `User submitted image`; } embeddedElement.innerHTML = ` - +
- +
@@ -431,15 +431,15 @@ function embed(links) {
- ${data.post.stats.loves} + ${escapeHtml(data.post.stats.loves)}
- ${data.post.stats.reposts} + ${escapeHtml(data.post.stats.reposts)}
- ${data.post.stats.comments} + ${escapeHtml(data.post.stats.comments)}
@@ -460,33 +460,33 @@ function embed(links) { embeddedElement.classList.add("wasteof-embed"); const request = new XMLHttpRequest(); - request.open('GET', `https://corsproxy.io/?https://api.wasteof.money/posts/${trackId}`); + request.open('GET', `https://corsproxy.io/?https://api.wasteof.money/posts/${escapeHtml(trackId)}`); request.onload = () => { const data = JSON.parse(request.responseText); embeddedElement.innerHTML = ` - +
- +
- ${data.content} + ${escapeHtml(data.content)}
- ${data.loves} + ${escapeHtml(data.loves)}
- ${data.reposts} + ${escapeHtml(data.reposts)}
- - ${data.comments} + + ${escapeHtml(data.comments)}