markdown-pdf icon indicating copy to clipboard operation
markdown-pdf copied to clipboard

CSS doesn't load on windows - fix

Open olup opened this issue 8 years ago • 3 comments

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.

olup avatar May 28 '16 14:05 olup

Works fine on Windows 7 too, thank you !

gurdilou avatar Jun 02 '17 12:06 gurdilou

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?

anko avatar Jul 18 '17 16:07 anko

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 problemmarkdownpdf

iursevla avatar Sep 25 '17 23:09 iursevla