diff --git a/src/Linkification/Linkify.coffee b/src/Linkification/Linkify.coffee index 36db98d3b..c1d5411c4 100755 --- a/src/Linkification/Linkify.coffee +++ b/src/Linkification/Linkify.coffee @@ -238,9 +238,11 @@ Linkify = key: 'gist' regExp: /.*(?:gist.github.com.*\/)([^\/][^\/]*)$/ el: (a) -> - $.el 'iframe', - # Github doesn't allow embedding straight from the site, so we use an external site to bypass that. - src: "http://www.purplegene.com/script?url=https://gist.github.com/#{a.dataset.uid}.js" + el = $.el 'iframe' + el.setAttribute 'sandbox', 'allow-scripts' + content = <%= html('${a.dataset.uid}') %> + el.src = "data:text/html;charset=utf-8,#{encodeURIComponent content.innerHTML}" + el title: api: (uid) -> "https://api.github.com/gists/#{uid}" text: ({files}) ->