Skip to content

Commit

Permalink
fix: don't encode by default
Browse files Browse the repository at this point in the history
Fixes remy#109
  • Loading branch information
remy committed Aug 9, 2016
1 parent 51ff9dd commit 109555f
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -239,9 +239,9 @@ function main() {
enc = 'utf-8';
}

cheerioLoadOptions.decodeEntities = false;
if (enc !== 'utf-8') {
debug('decoding from: %s', enc);
cheerioLoadOptions.decodeEntities = false;
body = iconv.encode(iconv.decode(res.body, enc), 'utf-8');
} else {
body = res.body;
Expand Down
12 changes: 6 additions & 6 deletions test/fixtures/html-whitespaces.result.html
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>html whitespaces</title> </head> <body> <div><code>// projector page window.addEventListener(&apos;storage&apos;, function (event) { if (event.key === &apos;currentSlide&apos;) { goToSlide(event.newValue); } });</code></div> <pre><code>// projector page
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>html whitespaces</title> </head> <body> <div><code>// projector page window.addEventListener('storage', function (event) { if (event.key === 'currentSlide') { goToSlide(event.newValue); } });</code></div> <pre><code>// projector page

window.addEventListener(&apos;storage&apos;, function (event) {
window.addEventListener('storage', function (event) {

if (event.key === &apos;currentSlide&apos;) {
if (event.key === 'currentSlide') {
goToSlide(event.newValue);
}
});</code></pre> <textarea><code>// projector page

window.addEventListener(&apos;storage&apos;, function (event) {
window.addEventListener('storage', function (event) {

if (event.key === &apos;currentSlide&apos;) {
if (event.key === 'currentSlide') {
goToSlide(event.newValue);
}
});</code></textarea> </body> </html>
});</code></textarea> </body> </html>
2 changes: 1 addition & 1 deletion test/fixtures/image-style-attr.result.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>css image in style attr</title> </head> <body> <div style="background:url(&quot;data:image/gif;base64,R0lGODlhAQABAIABAP///wAAACwAAAAAAQABAAACAkQBADs=&quot;) repeat;"></div> <div style="background:url(&quot;data:image/gif;base64,R0lGODlhAQABAIABAP///wAAACwAAAAAAQABAAACAkQBADs=&quot;) repeat;"></div> <div style="background:url(&quot;data:image/gif;base64,R0lGODlhAQABAIABAP///wAAACwAAAAAAQABAAACAkQBADs=&quot;) repeat;"></div> <div style="background:url(&quot;data:image/gif;base64,R0lGODlhAQABAIABAP///wAAACwAAAAAAQABAAACAkQBADs=&quot;) repeat;"></div> </body> </html>
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>css image in style attr</title> </head> <body> <div style="background:url("data:image/gif;base64,R0lGODlhAQABAIABAP///wAAACwAAAAAAQABAAACAkQBADs=") repeat;"></div> <div style="background:url("data:image/gif;base64,R0lGODlhAQABAIABAP///wAAACwAAAAAAQABAAACAkQBADs=") repeat;"></div> <div style="background:url("data:image/gif;base64,R0lGODlhAQABAIABAP///wAAACwAAAAAAQABAAACAkQBADs=") repeat;"></div> <div style="background:url("data:image/gif;base64,R0lGODlhAQABAIABAP///wAAACwAAAAAAQABAAACAkQBADs=") repeat;"></div> </body> </html>

0 comments on commit 109555f

Please sign in to comment.