maizzle / maizzle-php

Jigsaw-based PHP build system for rapid HTML email development with Tailwind CSS.
https://jigsaw.maizzle.com
MIT License
304 stars 6 forks source link

Switch to loading HTML as file url rather than loading HTML directly as a string #31

Closed grumpysi closed 5 years ago

grumpysi commented 5 years ago

This enables relative URLs for testing and also solves some encodeURI issues. Screenshots were just blank white pages because of encoding issues.

cossssmin commented 5 years ago

Hmm, using base64 data was added in f5910a0ba645a7249e66e9f9e6c7ee82e5d27914, because screenshots weren't working on the Mac...

Is it possible for you to share a repo that reproduces the encoding error?

grumpysi commented 5 years ago

You should have access now.

grumpysi commented 5 years ago

Adding let html = encodeURIComponent(fs.readFileSync(path.join(process.cwd(), args.file), 'utf8')); Solved the issue with Chromium and the white screen. But loading from file made life easier with relative image paths for testing.

grumpysi commented 5 years ago

All done. No problem. Great tool by the way. Thanks for sharing.

cossssmin commented 5 years ago

Thank you!