adamburmister / gitprint.com

Render Github markdown documents for printing
346 stars 28 forks source link

Gist feature not working #61

Open omniproc opened 7 years ago

omniproc commented 7 years ago

E.g. https://gist.gitprint.com/vasco3/22b09ef0ca5e0f8c5996 ( https://gist.github.com/vasco3/22b09ef0ca5e0f8c5996 ) will not render in chrome 57.

Mause commented 7 years ago

https://gitprint.com/vasco3/22b09ef0ca5e0f8c5996/raw

omniproc commented 7 years ago

I guess then the URL generated by the bookmarklet / chrome app is wrong. Currently it is: javascript:void((function(){if(document.location.hostname.indexOf('github.com')!==-1){window.open(document.URL.replace('github.com','gitprint.com'),'_blank');}})());

A fix should be as simple as this (can be done cleaner): javascript:void((function(){if(document.location.hostname.indexOf('gist.github.com')!==-1){var url = document.URL.replace('gist.github.com','gitprint.com') + '/raw';window.open(url,'_blank');}else if(document.location.hostname.indexOf('github.com')!==-1){window.open(document.URL.replace('github.com','gitprint.com'),'_blank');}})());

liquidnight2 commented 7 years ago

Hi, thanks for the idea - I also tried to print a gist Url, could not do it with that tool. https://gist.github.com/jFransham/369a86eff00e5f280ed25121454acec1

Maybe adding a url= parameter ?