codePreviews: ignore non-plaintext
This commit is contained in:
parent
a8f59ea6ac
commit
0a6417c0f7
1 changed files with 1 additions and 0 deletions
|
@ -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");
|
||||
|
||||
|
|
Loading…
Reference in a new issue