Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ionic upload modify index.html #452

Closed
thomas-tran opened this issue Jun 2, 2015 · 29 comments
Closed

ionic upload modify index.html #452

thomas-tran opened this issue Jun 2, 2015 · 29 comments

Comments

@thomas-tran
Copy link

I tried to upload project to ionic view for testing. The CLI modified my index and put extra characters  as a result my app was broken.

@jbavari
Copy link

jbavari commented Jun 2, 2015

Can you post some before and after HTML?

Also, ionic info - and post that info here.

@jbavari jbavari self-assigned this Jun 2, 2015
@thomas-tran
Copy link
Author

Hi jbavari,

Here are the before and after

Before

before

After upload

after

ionic info

info

@simplesmiler
Copy link

@thomas-tran it looks like BOM. What text editor do you use?

@thomas-tran
Copy link
Author

Visual studio 2013
On 04/06/2015 6:46 AM, "Denis Karabaza" notifications@github.com wrote:

@thomas-tran https://github.com/thomas-tran it looks like BOM. What
text editor do you use?


Reply to this email directly or view it on GitHub
#452 (comment).

@bradmartin
Copy link

Had the same issue, I closed Visual Studio, opened the index.html file in Notepad ++ and changed the encoding to ' Encode in UTF without BOM', then run IONIC UPLOAD and all is fine. I know it's not a fix but it's a workaround until the issue is resolved. @thomas-tran @jbavari

@jbavari
Copy link

jbavari commented Jun 5, 2015

@bradmartin @thomas-tran - Working on a fix now - going to just remove the BOM and save the file as is.

Would anyone be available to test it to make sure it doesnt cause any issues with Visual studio?

@bradmartin
Copy link

I'll test it later today.

On Fri, Jun 5, 2015 at 12:03 PM, Josh Bavari notifications@github.com
wrote:

@bradmartin https://github.com/bradmartin @thomas-tran
https://github.com/thomas-tran - Working on a fix now - going to just
remove the BOM and save the file as is.

Would anyone be available to test it to make sure it doesnt cause any
issues with Visual studio?


Reply to this email directly or view it on GitHub
#452 (comment).

@squiso
Copy link

squiso commented Jun 6, 2015

@bradmartin - Thanks for the workaround! I haven't had any issues with Visual Studio.

@bradmartin
Copy link

@jbavari no longer modifies the index.html file when VS is opened or closed. Thanks for the fix, saves me a minute or two when uploading.

@bradmartin
Copy link

@jbavari The fix isn't working anymore.

@bradmartin
Copy link

@jbavari - another issue with ionic upload.

apos

@bradmartin
Copy link

This was after setting 'Encoding without BOM' via notepad ++ with VS closed. Since the work around you pushed a couple days ago quit working today.

@jbavari
Copy link

jbavari commented Jun 30, 2015

@bradmartin In the screenshot you provided with ' - what was the original content?

I'll whip together a test to ensure that doesnt happen.

@bradmartin
Copy link

@jbavari - Not near the source code at the moment but it was either single quote or double quote, was just passing the state as a string. If that's what you're asking. If you need more details let me know.

@jbavari
Copy link

jbavari commented Jul 1, 2015

@bradmartin It's all good. Looks to be a simple fix by adding { decodeEntities: false } to the parser. Will have this patched in next version.

@jbavari
Copy link

jbavari commented Jul 1, 2015

@bradmartin This should solve it - with test to verify :)

ionic-team/ionic-app-lib@b757d38

@bradmartin
Copy link

@jbavari - sorry for my ignorance. I'm using Ionic CLI 1.5.5, so will this fix be present or shipped with an update to the CLI? I just ran 'ionic upload' and all of my single quotes were modified to '&apos' . Thanks for your help.

@jbavari
Copy link

jbavari commented Jul 2, 2015

Yes, in the next release, this will be fixed.

@bradmartin Try out the beta version to see if that works: npm install -g ionic@beta

@nobosny
Copy link

nobosny commented Jul 4, 2015

screen shot 2015-07-04 at 7 59 25 pm
Hi, I just downloaded and updated my ionic-app-lib to the latest version, 0.3.2, I checked the code, and the "decodeEntities" fix is ok. But when I upload my ionic app to IonicView, it keeps changing my urls. I tried ionic@beta, and everything, but nothing seems to work.

@bradmartin
Copy link

Yea I'm using beta and noticed there are still some odd issues.

The only fix I have is to open notepad ++ and change the encoding to 'UTF
without BOM' and save the file. Also, I close Visual Studio just to be
safe, it seems that when VS is open and I run 'ionic upload' it always
messes something up.

On Sat, Jul 4, 2015 at 6:51 PM, nobosny notifications@github.com wrote:

Hi, I just downloaded and updated my ionic-app-lib to the latest version,
0.3.2, I checked the code, and the "decodeEntities" fix is ok. But when I
upload my ionic app to IonicView, it keeps changing my urls. I tried
ionic@beta, and everything, but nothing seems to work.


Reply to this email directly or view it on GitHub
#452 (comment).

@nobosny
Copy link

nobosny commented Jul 5, 2015

Thank you bradmartin, but I tried that too, and just when I try to upload, it changes my index.html, all my single quotes are changed to "apos;" with a & in front (if I put it here, it turns into the html character), and since I'm trying to embed a Google Map on my app, i'm using Content-Security-Policy and external google javascript files. I'm not able to test the app using IonicView.

@salbahra
Copy link

salbahra commented Dec 9, 2015

I am still experiencing the same issue as @nobosny regarding the Content-Security-Policy issue. If there is anything I can provide to help please let me know.

Thank you!

System information:

Cordova CLI: 5.4.1
Gulp version:  CLI version 3.9.0
Gulp local:   Local version 3.9.0
Ionic Version: 1.1.1
Ionic CLI Version: 1.7.11
Ionic App Lib Version: 0.6.5
ios-deploy version: 1.8.2 
ios-sim version: 4.1.1 
OS: Mac OS X El Capitan
Node Version: v0.12.7
Xcode version: Xcode 7.1.1 Build version 7B1005 

@deinerson1
Copy link

I am experiencing the same issue as @nobosny regarding the Content-Security-Policy issue. If there is anything I can provide to help please let me know.

System information:
Cordova CLI: 6.0.0
Gulp version: CLI version 3.9.1
Gulp local: Local version 3.9.1
Ionic Version: 1.2.4
Ionic CLI Version: 1.7.14
Ionic App Lib Version: 0.7.0
OS: Distributor ID: Ubuntu Description: Ubuntu 15.10
Node Version: v0.12.10

@qmarcos
Copy link

qmarcos commented Jun 9, 2016

This issue is not solved... above is my ionic info, but I did some test and not only is not working with the spec/index.html file case, also with the Content-Security-Policy meta that is also referenced here.

I've checked the upload.js code and it includes the fix, but the fix doesn't solve the problem.

With this bug seems that is not possible to use ionic upload to test apps with ionic view if you need a CSP or some special chars inside HTML attributes :_(

Thanks in advance!

Cordova CLI: Not installed
Gulp version:  CLI version 3.9.0
Gulp local:  
Ionic Framework Version: 1.3.1
Ionic CLI Version: 1.7.15
Ionic App Lib Version: 0.7.2
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Mac OS X El Capitan
Node Version: v0.12.6
Xcode version: Not installed

@mlynch
Copy link
Contributor

mlynch commented Jun 9, 2016

We are taking a look for an upcoming View update. Thanks for the info.

@qmarcos
Copy link

qmarcos commented Jun 9, 2016

Hi @mlynch it sounds fantastic to me 👍

@GeekG1rl
Copy link

@mlynch Any updates on this? Getting pretty desperate here 😢

@tlancina
Copy link
Contributor

This should be fixed in the latest version of the CLI. Let us know if you're still having issues, thanks!

@tlancina tlancina reopened this Jun 23, 2016
@qmarcos
Copy link

qmarcos commented Jun 27, 2016

I'll give it a try in the following days, keep you informed 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests