fix: Remove redundant trailing comma after inlined CSS @import

Fixes #142
This commit is contained in:
Ildar Sagdejev 2017-05-19 01:22:01 -04:00 committed by Remy Sharp
parent 64d218bb18
commit 5786954e07
6 changed files with 6 additions and 6 deletions

View File

@ -78,7 +78,7 @@ function getImports(root, css) {
importedCSS = '@media ' + url.join(' ') + '{' + importedCSS + '}';
}
css = css.replace('@import' + match, importedCSS);
css = css.replace('@import' + match + ';', importedCSS);
return getImports.call(inliner, root, css);
});
}

View File

@ -1 +1 @@
<!DOCTYPE html> <html> <head> <title>External css and multibyte characters - 日本語</title> <style> .body2{width:100%;font-family:"メイリオ", "ヒラギノ角ゴ Pro W3", "MS PGothic", "MS UI Gothic", Helvetica, Arial, sans-serif;};body{ font-family:"メイリオ", "ヒラギノ角ゴ Pro W3", "MS PGothic", "MS UI Gothic", Helvetica, Arial, sans-serif;}</style> </head> <body> </body> </html>
<!DOCTYPE html> <html> <head> <title>External css and multibyte characters - 日本語</title> <style> .body2{width:100%;font-family:"メイリオ", "ヒラギノ角ゴ Pro W3", "MS PGothic", "MS UI Gothic", Helvetica, Arial, sans-serif;}body{ font-family:"メイリオ", "ヒラギノ角ゴ Pro W3", "MS PGothic", "MS UI Gothic", Helvetica, Arial, sans-serif;}</style> </head> <body> </body> </html>

View File

@ -1 +1 @@
<!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> <meta charset="UTF-8"> <title>App</title> <style>p{ font-size:10px;background:url("data:image/gif;base64,R0lGODlhAQABAIABAP///wAAACwAAAAAAQABAAACAkQBADs=") repeat;}p:before{ content:'<';color:blue;};</style> </head> <body> body </body> </html>
<!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> <meta charset="UTF-8"> <title>App</title> <style>p{ font-size:10px;background:url("data:image/gif;base64,R0lGODlhAQABAIABAP///wAAACwAAAAAAQABAAACAkQBADs=") repeat;}p:before{ content:'<';color:blue;}</style> </head> <body> body </body> </html>

View File

@ -1 +1 @@
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>inline style</title> <style> p{ font-size:10px;background:url("data:image/gif;base64,R0lGODlhAQABAIABAP///wAAACwAAAAAAQABAAACAkQBADs=") repeat;}p:before{ content:'<';color:blue;}; p{ font-size:10px;background:url("data:image/gif;base64,R0lGODlhAQABAIABAP///wAAACwAAAAAAQABAAACAkQBADs=") repeat;}p:before{ content:'<';color:blue;}; p{ font-size:10px;background:url("data:image/gif;base64,R0lGODlhAQABAIABAP///wAAACwAAAAAAQABAAACAkQBADs=") repeat;}p:before{ content:'<';color:blue;}; @media screen and orientation:landscape{p{ font-size:10px;background:url("data:image/gif;base64,R0lGODlhAQABAIABAP///wAAACwAAAAAAQABAAACAkQBADs=") repeat;}p:before{ content:'<';color:blue;}}; p{ font-size:10px;background:url("data:image/gif;base64,R0lGODlhAQABAIABAP///wAAACwAAAAAAQABAAACAkQBADs=") repeat;}p:before{ content:'<';color:blue;};</style> </head> <body> </body> </html>
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>inline style</title> <style> p{ font-size:10px;background:url("data:image/gif;base64,R0lGODlhAQABAIABAP///wAAACwAAAAAAQABAAACAkQBADs=") repeat;}p:before{ content:'<';color:blue;} p{ font-size:10px;background:url("data:image/gif;base64,R0lGODlhAQABAIABAP///wAAACwAAAAAAQABAAACAkQBADs=") repeat;}p:before{ content:'<';color:blue;} p{ font-size:10px;background:url("data:image/gif;base64,R0lGODlhAQABAIABAP///wAAACwAAAAAAQABAAACAkQBADs=") repeat;}p:before{ content:'<';color:blue;} @media screen and orientation:landscape{p{ font-size:10px;background:url("data:image/gif;base64,R0lGODlhAQABAIABAP///wAAACwAAAAAAQABAAACAkQBADs=") repeat;}p:before{ content:'<';color:blue;}} p{ font-size:10px;background:url("data:image/gif;base64,R0lGODlhAQABAIABAP///wAAACwAAAAAAQABAAACAkQBADs=") repeat;}p:before{ content:'<';color:blue;}</style> </head> <body> </body> </html>

View File

@ -1 +1 @@
<style> @font-face{ font-family:'PT Sans';font-style:normal;font-weight:400;src:local('PT Sans'), local('PTSans-Regular'), format('woff2');unicode-range:U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F;};@font-face{ font-family:'PT Sans';font-style:normal;font-weight:400;src:local('PT Sans'), local('PTSans-Regular'), format('woff2');unicode-range:U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F;};html{ font-family:"PT Sans",courier;font-size:14px;}</style>
<style> @font-face{ font-family:'PT Sans';font-style:normal;font-weight:400;src:local('PT Sans'), local('PTSans-Regular'), format('woff2');unicode-range:U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F;}@font-face{ font-family:'PT Sans';font-style:normal;font-weight:400;src:local('PT Sans'), local('PTSans-Regular'), format('woff2');unicode-range:U+0460-052F, U+20B4, U+2DE0-2DFF, U+A640-A69F;}html{ font-family:"PT Sans",courier;font-size:14px;}</style>

View File

@ -1 +1 @@
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>full combo</title> <style>p{ font-size:10px;background:url("data:image/gif;base64,R0lGODlhAQABAIABAP///wAAACwAAAAAAQABAAACAkQBADs=") repeat;}p:before{ content:'<';color:blue;}</style> <style> p{ font-size:10px;background:url("data:image/gif;base64,R0lGODlhAQABAIABAP///wAAACwAAAAAAQABAAACAkQBADs=") repeat;}p:before{ content:'<';color:blue;};body{ font-family:sans-serif;}#icon{ height:48px;width:48px;background:url("data:image/gif;base64,R0lGODlhAQABAIABAP///wAAACwAAAAAAQABAAACAkQBADs=") no-repeat;background-size:cover;}</style> </head> <body> <script>function doit(o){return"remy"+(o.bar="sharp").split("").reverse().join("")}console.log(doit(window));</script> <script>console.log("Hello world");</script> <img src="data:image/gif;base64,R0lGODlhAQABAIABAP///wAAACwAAAAAAQABAAACAkQBADs=" title="White 1x1"> <div id="icon"></div> </body> </html>
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>full combo</title> <style>p{ font-size:10px;background:url("data:image/gif;base64,R0lGODlhAQABAIABAP///wAAACwAAAAAAQABAAACAkQBADs=") repeat;}p:before{ content:'<';color:blue;}</style> <style> p{ font-size:10px;background:url("data:image/gif;base64,R0lGODlhAQABAIABAP///wAAACwAAAAAAQABAAACAkQBADs=") repeat;}p:before{ content:'<';color:blue;}body{ font-family:sans-serif;}#icon{ height:48px;width:48px;background:url("data:image/gif;base64,R0lGODlhAQABAIABAP///wAAACwAAAAAAQABAAACAkQBADs=") no-repeat;background-size:cover;}</style> </head> <body> <script>function doit(o){return"remy"+(o.bar="sharp").split("").reverse().join("")}console.log(doit(window));</script> <script>console.log("Hello world");</script> <img src="data:image/gif;base64,R0lGODlhAQABAIABAP///wAAACwAAAAAAQABAAACAkQBADs=" title="White 1x1"> <div id="icon"></div> </body> </html>