Closed jordwalke closed 7 years ago
on the left side is what inliner
does, and the right is what webpage2html
does.
I'm pretty sure it's just that dangling (incorrect) semicolon.
Can you upload a small gist that contains the files to replicate this? I can then make a test case against it to fix the issue.
Any chance of the test case?
The gist is just that you put this in any css:
@import url("../fontSupport/montserratCSS.css");
And the result is like the screenshot on the left - a dangling semicolon appears.
I believe that the @import
should have a semicolon in the input, but not font-face (in the output)
I'm getting the trailing semicolon after the CSS import.
index.html
<html>
<head>
<link rel="stylesheet" href="main.css">
</head>
</html>
main.css
@import url("second.css");
second.css
body {
background-color: black;
}
The output is:
<html> <head> <style>body{ background-color:black;};</style> </head> </html>
Current test results for CSS imports, for example test/fixtures/css-ext-import.result.html, show the same ;
after inlining a CSS @import
.
I think what's happening is the trailing semicolon terminating the @import statement isn't being erased when said statement is replaced with the imported contents.
I had to place the
@import url("../fontSupport/montserratCSS.css");
at the bottom of my CSS file instead of the top, for this to work. Note, I'm loading an html file off of the local file system (not sure it matters).This other project works correctly even with the import at the top of the css file - worth looking into what they do differently.
As a result of what ever
inliner
is doing, all the following CSS rules are not processed.