marp-team / marp-cli

A CLI interface for Marp and Marpit based converters
MIT License
1.85k stars 105 forks source link

no images appear in mobile view of .html file,but it appears on pc #583

Closed nykbocks closed 1 month ago

nykbocks commented 1 month ago

i dont know what to do,i've tried everething,but neithter the images or the custom fonts appear on the mobile view,but it works perfectly on the pc,i dont know what more to explain,but the file is simple slide.md

yhatt commented 1 month ago

How are you delivering HTML file and assets to mobile devices?

nykbocks commented 1 month ago

Aa a zip,i have this struct: -slide.zip --slide.html --assets: ---*.PNG;

so you decompress the zip,and open it,in pc as said it works,but even if a decompress it in mobile,using Zarchiver on like the downloads folder and opening the file with chrome,no images appear.

yhatt commented 1 month ago

In general, the present mobile OS allow browsing only a selected local resource due to security reasons. An opened HTML file may be isolated from file systems (by using content:// URI scheme when you are using Android). If so, it cannot access to any other local assets.

See also: https://stackoverflow.com/a/70578829

So you have to find a way to open the HTML with file:/// URI scheme, or opening HTML file through Web server instead. (That is outside the scope of Marp)

yhatt commented 1 month ago

Close this issue because there are no issues in the HTML output of Marp CLI. To show the correct view on mobile devices, please consider delivering slides with assets through any Web server.