Skip to content

Commit

Permalink
Fix: Add '&' support for queryString
Browse files Browse the repository at this point in the history
  • Loading branch information
Rushikesh Patange committed Aug 9, 2023
1 parent 8ccbb71 commit 11a59a2
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,13 @@
converter.setFlavor("github");
const queryString = window.location.search;
const urlParams = new URLSearchParams(queryString);
const fileURL = urlParams.get("fileURL");
let parameter = "fileURL";
let fileURL = undefined;
if (queryString.includes("&")) {
fileURL = queryString.substring(queryString.search(parameter) + parameter.length + 1);
} else {
fileURL = urlParams.get(parameter);
}
fetch(fileURL)
.then((result) => result.text())
.then((data) => {
Expand Down

0 comments on commit 11a59a2

Please sign in to comment.