Skip to content

Commit

Permalink
Identify md file urls as text files
Browse files Browse the repository at this point in the history
  • Loading branch information
joserebelo committed Aug 27, 2023
1 parent 8cf4d0f commit 32dbbdf
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion js/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,8 @@ function htmlElement(str) {
return div.firstChild;
}
function httpGet(url) {
let isBinary = !(url.endsWith(".js") || url.endsWith(".json") || url.endsWith(".csv") || url.endsWith(".txt"));
let textExtensions = [".js", ".json", ".csv", ".txt", ".md"];
let isBinary = !textExtensions.some(ext => url.endsWith(ext));
return new Promise((resolve,reject) => {
let oReq = new XMLHttpRequest();
oReq.addEventListener("load", () => {
Expand Down

0 comments on commit 32dbbdf

Please sign in to comment.