codePreviews: ignore non-plaintext

This commit is contained in:
Cynthia Foxwell 2023-06-14 21:42:40 -06:00
parent a8f59ea6ac
commit 0a6417c0f7
1 changed files with 1 additions and 0 deletions

View File

@ -23,6 +23,7 @@ function unindent(str) {
async function processFile(link) {
const res = await fetch(link);
if (!res.ok) return "";
if (!res.headers.get("Content-Type").startsWith("text/plain")) return "";
const file = await res.text();
const lines = file.replace(/\r/g, "").split("\n");