elementor / static-html-output

Static HTML Output Plugin for WordPress
https://statichtmloutput.com
The Unlicense
125 stars 35 forks source link

site root relative icon href's not being rewritten properly #52

Closed leonstafford closed 4 years ago

leonstafford commented 4 years ago
<link rel="apple-touch-icon" sizes="180x180" href="/wp-content/uploads/fbrfg/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/wp-content/uploads/fbrfg/favicon-32x32.png">

resulting in

<link rel="apple-touch-icon" sizes="180x180" href="https://localhost/wp-content/uploads/fbrfg/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="https://localhost/wp-content/uploads/fbrfg/favicon-32x32.png">
thegulshankumar commented 4 years ago

Dev version always have relative URL but export turns with dev hostname while I have Relative Link checkbox enabled - https://youtu.be/ZtRxT4w0lzI

leonstafford commented 4 years ago

failing test confirms issue.working on fix

leonstafford commented 4 years ago

fixed within recent commits.

covered by test:

input: https://github.com/WP2Static/static-html-output-plugin/blob/master/tests/data/HTMLProcessorTest/input_process_links_without_stripping.html

output: https://github.com/WP2Static/static-html-output-plugin/blob/master/tests/data/HTMLProcessorTest/output_process_links_without_stripping.html

Showing tranformation of URL from

<link rel="apple-touch-icon" sizes="180x180" href="/w/apple-touch-icon.png">

to

<link rel="apple-touch-icon" sizes="180x180" href="https://mynewdomain.com/w/apple-touch-icon.png">