markdown-pdf
markdown-pdf copied to clipboard
CSS doesn't load on windows - fix
On windows 10, impossible to load CSS - the absolute path in the "href" has to be preceeded by
file:///
so in render.js (line 15)
var protocol = os.name === 'windows' ? '' : 'file://'
should probably be turned to :
var protocol = os.name === 'windows' ? 'file:///' : 'file://'
But i am not sure for other windows version.
Works fine on Windows 7 too, thank you !
PR #121 is essentially this change, so it may fix CSS too. We don't have a Windows CI yet: could a Windows user confirm?
I'm using version 8.0.0 on Windows 10 and i was wondering why my pdfs wouldn't use any css. @olup is right, with his change in line 15 of render.js it works.
I tried to use markdown-pdf two months ago but i gave up because the style was really bad and even trying to use other styles wouldn't work. Yet there's no documentation to how we should use the CSS. Because even using monokay.css from highlight.js it's still looking really bad here.
I'm missing something? The custom css highlight file is enought or i need to have something else? Should i create one issue about the lack of documentation for highlighting?
EDIT: I tried in Linux Ubuntu with the exact same code and it works. Left Linux Ubuntu 17.04, right Windows 10