michaelrsweet / htmldoc

HTML Conversion Software
https://www.msweet.org/htmldoc
GNU General Public License v2.0
208 stars 47 forks source link

add file:// method #512

Open step- opened 1 year ago

step- commented 1 year ago

Issue https://github.com/michaelrsweet/htmldoc/issues/508 reports that href file://... is mapped to http://remote.../file://..., which will never open in modern browsers capable of opening the "file://" method.

This is a proposed fix for #508.

The screenshot illustrates the use case. After converting an online HTML document to PDF (using the command shown in #507), open the output file in a PDF viewer, scroll down to the link in the screenshot, and click the link. Without this commit the PDF viewer, then the browser, open http://remote.../file://..., and fail. With this commit the "file://" method is preserved, so the browser can successfully open a local file.

screenshot