remy / inliner

Node utility to inline images, CSS and JavaScript for a web page - useful for mobile sites
MIT License
1.1k stars 165 forks source link

--skip-absolute-urls detects some relative URLs as absolute #126

Closed cashpipeplusplus closed 7 years ago

cashpipeplusplus commented 7 years ago

This HTML is not properly inlined with --skip-absolute-urls:

<!doctype html>
<html lang="en">
  <head>
    <link rel="shortcut icon" href="dummy.ico">
    <link rel="stylesheet" href="dummy.css">
    <script src="dummy.js"></script>
  </head>
  <body>
    <img src="dummy.png" />
    <video poster="dummy.jpg" src="dummy.mp4"></video>
  </body>
</html>

Only dummy.js gets inlined here.

I found the problem in the sources. In many places, URLs are resolved before the absolute URL check is run. I'm preparing a pull request to fix this.