Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

1. by bumping version of dependend jsdom to 0.2.19 fixed problems wit…

…h using juice with node 9.3 (used node-gyp instead node-waf)

2. fixed problems with inproper construction of test/cases - in .html/.out files was invalid html documents, jsdom automaticly fix them by wrapping using <html><body></body></html> tags, so all test/cases/* were wrong
3. added new test/cases/empty* test to ensure that juice is shy and tidy and conserve unstyled tags and empty documents.
  • Loading branch information...
commit 0ccd3fc85d990dee4ea9d2d1eb454b2e5268cf19 1 parent 91c2407
Paweł Marzec authored
Showing with 59 additions and 3 deletions.
  1. +1 −0  .gitignore
  2. +1 −1  lib/juice.js
  3. +3 −2 package.json
  4. +2 −0  test/cases/cascading.html
  5. +2 −0  test/cases/cascading.out
  6. +2 −0  test/cases/class+id.html
  7. +2 −0  test/cases/class+id.out
  8. +3 −0  test/cases/class.html
  9. +2 −0  test/cases/class.out
  10. +2 −0  test/cases/css-quotes.html
  11. +2 −0  test/cases/css-quotes.out
  12. +2 −0  test/cases/direct-descendents.html
  13. +2 −0  test/cases/direct-descendents.out
  14. +2 −0  test/cases/id.html
  15. +2 −0  test/cases/id.out
  16. +2 −0  test/cases/ignore-pseudos.html
  17. +2 −0  test/cases/ignore-pseudos.out
  18. +2 −0  test/cases/important.html
  19. +2 −0  test/cases/important.out
  20. +2 −0  test/cases/preserve-events.html
  21. +2 −0  test/cases/preserve-events.out
  22. +2 −0  test/cases/regression-selector-newline.html
  23. +2 −0  test/cases/regression-selector-newline.out
  24. +2 −0  test/cases/specificity.html
  25. +2 −0  test/cases/specificity.out
  26. +2 −0  test/cases/style-preservation.html
  27. +3 −0  test/cases/style-preservation.out
  28. +2 −0  test/cases/tag.html
  29. +2 −0  test/cases/tag.out
View
1  .gitignore
@@ -1 +1,2 @@
node_modules
+*~
View
2  lib/juice.js
@@ -121,7 +121,7 @@ function juice (html, css, options) {
});
var inner = document.innerHTML;
-
+
// free the associated memory
// with lazily created parentWindow
document.parentWindow.close();
View
5 package.json
@@ -1,14 +1,15 @@
{
"name": "juice"
- , "version": "0.0.6"
+ , "version": "0.0.7"
, "description": "Inlines css into html source"
, "contributors": [
{ "name": "Guillermo Rauch", "email": "guillermo@learnboost.com" }
, { "name": "Arian Stolwijk", "email": "arian@aryweb.nl" }
+ , { "name": "Paweł Marzec", "email": "rork@cojestgrane.pl" }
]
, "dependencies": {
"cssom": "0.2.3"
- , "jsdom": "0.2.15"
+ , "jsdom": "0.2.19"
, "mootools-slick-parser": "1.3.2"
}
, "devDependencies": {
View
2  test/cases/cascading.html
@@ -1,3 +1,4 @@
+<html><body>
<ul>
<li>
<ul>
@@ -9,3 +10,4 @@
</ul>
</li>
</ul>
+</body></html>
View
2  test/cases/cascading.out
@@ -1,3 +1,4 @@
+<html><body>
<ul>
<li style="display: block; color: #f00;">
<ul>
@@ -9,3 +10,4 @@
</ul>
</li>
</ul>
+</body></html>
View
2  test/cases/class+id.html
@@ -1 +1,3 @@
+<html><body>
<p id="test" class="woot">Woot</p>
+</body></html>
View
2  test/cases/class+id.out
@@ -1 +1,3 @@
+<html><body>
<p id="test" class="woot" style="border: 1px solid #f00; display: inline-block;">Woot</p>
+</body></html>
View
3  test/cases/class.html
@@ -1,2 +1,5 @@
+<html><body>
<div class="woot">Test</div>
<div class="woot">Test</div>
+</body></html>
+
View
2  test/cases/class.out
@@ -1,2 +1,4 @@
+<html><body>
<div class="woot" style="overflow: hidden;">Test</div>
<div class="woot" style="overflow: hidden;">Test</div>
+</body></html>
View
2  test/cases/css-quotes.html
@@ -1 +1,3 @@
+<html><body>
<p>woot</p>
+</body></html>
View
2  test/cases/css-quotes.out
@@ -1 +1,3 @@
+<html><body>
<p style="background: url(/woot);">woot</p>
+</body></html>
View
2  test/cases/direct-descendents.html
@@ -1 +1,3 @@
+<html><body>
<p><em><em>woot</em></em></p>
+</body></html>
View
2  test/cases/direct-descendents.out
@@ -1 +1,3 @@
+<html><body>
<p><em style="background: blue; color: red;"><em style="background: blue;">woot</em></em></p>
+</body></html>
View
2  test/cases/id.html
@@ -1 +1,3 @@
+<html><body>
<div id="test">woot</div>
+</body></html>
View
2  test/cases/id.out
@@ -1 +1,3 @@
+<html><body>
<div id="test" style="display: none;">woot</div>
+</body></html>
View
2  test/cases/ignore-pseudos.html
@@ -1 +1,3 @@
+<html><body>
<a href="#">Test</a>
+</body></html>
View
2  test/cases/ignore-pseudos.out
@@ -1 +1,3 @@
+<html><body>
<a href="#" style="text-decoration: underline;">Test</a>
+</body></html>
View
2  test/cases/important.html
@@ -1 +1,3 @@
+<html><body>
<a id="a" style="color: blue; background: green;">woot</a>
+</body></html>
View
2  test/cases/important.out
@@ -1 +1,3 @@
+<html><body>
<a id="a" style="color: red; background: blue; border-style: dashed;">woot</a>
+</body></html>
View
2  test/cases/preserve-events.html
@@ -1,2 +1,4 @@
+<html><body>
<a href="#" onclick="return false;">Google</a>
<p onclick="return false;">Google</p>
+</body></html>
View
2  test/cases/preserve-events.out
@@ -1,2 +1,4 @@
+<html><body>
<a href="#" onclick="return false;">Google</a>
<p onclick="return false;" style="color: red;">Google</p>
+</body></html>
View
2  test/cases/regression-selector-newline.html
@@ -1,2 +1,4 @@
+<html><body>
<a href="#">Test</a>
<p>Test</p>
+</body></html>
View
2  test/cases/regression-selector-newline.out
@@ -1,2 +1,4 @@
+<html><body>
<a href="#" style="color: red;">Test</a>
<p style="color: red;">Test</p>
+</body></html>
View
2  test/cases/specificity.html
@@ -1,5 +1,7 @@
+<html><body>
<div id="wrap" a="b">
<div class="wrap" id="wrap-2">
<div id="a"></div>
</div>
</div>
+</body></html>
View
2  test/cases/specificity.out
@@ -1,5 +1,7 @@
+<html><body>
<div id="wrap" a="b">
<div class="wrap" id="wrap-2" style="display: inline-block;">
<div id="a" style="color: red; display: block; background: green; border-color: green;"></div>
</div>
</div>
+</body></html>
View
2  test/cases/style-preservation.html
@@ -1 +1,3 @@
+<html><body>
<p style="color: red;">The color should stay intact</p>
+</body></html>
View
3  test/cases/style-preservation.out
@@ -1 +1,4 @@
+<html><body>
<p style="color: red; background: blue;">The color should stay intact</p>
+</body></html>
+
View
2  test/cases/tag.html
@@ -1 +1,3 @@
+<html><body>
<p>Test</p>
+</body></html>
View
2  test/cases/tag.out
@@ -1 +1,3 @@
+<html><body>
<p style="border: 1px solid #f00; margin: 1px;">Test</p>
+</body></html>
Please sign in to comment.
Something went wrong with that request. Please try again.