Skip to content
This repository has been archived by the owner on Jan 6, 2023. It is now read-only.

Commit

Permalink
Fix(upload): Remove entity parsing to fix ionic-team/ionic-cli#452 (c…
Browse files Browse the repository at this point in the history
  • Loading branch information
jbavari committed Jul 1, 2015
1 parent c133c05 commit b757d38
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -250,8 +250,9 @@ Upload.addCacheBusters = function addCacheBusters(indexPath) {

var randomString = Math.floor(Math.random() * 100000);
var indexHtml = fs.readFileSync(indexPath, 'utf8');
var $ = cheerio.load(indexHtml);
var $ = cheerio.load(indexHtml, { decodeEntities: false });
var urlObj;

try {
$('script').each(function(i, el){
if (typeof el.attribs.src === "undefined") return true; //continue
Expand Down
1 change: 1 addition & 0 deletions spec/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@
</ion-nav-back-button>
</ion-nav-bar>
<ion-nav-view></ion-nav-view>
<paper-item ng-click="goToState('dash')">Test item with apostrophes</paper-item>
</body>
</html>
4 changes: 4 additions & 0 deletions spec/upload.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ describe('Upload', function() {
//Fix for https://github.com/driftyco/ionic-cli/issues/452
var bomIndex = indexHtml.indexOf('&#xFEFF;');
expect(bomIndex).toBe(-1);

//Fix for https://github.com/driftyco/ionic-cli/issues/452#issuecomment-117376542
var aposIndex = indexHtml.indexOf("goToState('dash')");
expect(aposIndex).not.toBe(-1);
})
.catch(function(ex){
expect('this').toBe(ex.stack);
Expand Down

0 comments on commit b757d38

Please sign in to comment.