How can one display the contents of a GitHub Gist while parsing a markdown file client-side using Marked.js or with any other client Markdown library? The code below renders the Markdown file except the Gist.
fetch("https://raw.githubusercontent.com/Ayanmullick/test/master/ScriptTagTest.md")
.then(response => response.blob()) // Unwrap to a blob...
.then(blob => blob.text()) // ...then to raw text...
.then(markdown => { // .pass raw text into marked.parse
document.getElementById("content").innerHTML=marked.parse(markdown)
})
<script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
<div id="content"></div>
However, the Gist renders OK in Visual Studio Code after disabling Markdown content preview settings
: Disable preview security warning in this workspace
.