Skip to content

Commit

Permalink
Merge pull request #54 from joserebelo/readme-utf-8
Browse files Browse the repository at this point in the history
Identify md file urls as text files
  • Loading branch information
gfwilliams authored Aug 29, 2023
2 parents 8cf4d0f + 32dbbdf commit 431a3fb
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 431a3fb

Please sign in to comment.