ionic-framework icon indicating copy to clipboard operation
ionic-framework copied to clipboard

bug: 'ionic upload' replaces single quotes in my index.html with `'` and '&' with `&`

Open marioharper opened this issue 11 years ago • 9 comments

Type: bug

Platform: all

Whenever executing ionic upload my index.html file changes all single quotes to ' and all "&" with &

Example:

<span ng-show="vm.searching && !vm.found">
  <i class="icon ion-search"></i>
</span>

Turns into:

<span ng-show="vm.searching &amp;&amp; !vm.found">
  <i class="icon ion-search"></i>
</span>

System Info: Cordova CLI: 5.3.3 Ionic Version 1.1.0 Ionic CLI Version: 1.6.5 Ionic App Lib Version: 0.3.9 OS: Windows 8.1 Node Version: v4.1.0

marioharper avatar Oct 09 '15 04:10 marioharper

+1

bymodude avatar Oct 14 '15 08:10 bymodude

+1 My Content-Security-Policy goes from:

<meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval' *; style-src  'self' 'unsafe-inline' *">

To:

<meta http-equiv="Content-Security-Policy" content="default-src &apos;self&apos;; script-src &apos;self&apos; &apos;unsafe-inline&apos; &apos;unsafe-eval&apos; *; style-src  &apos;self&apos; &apos;unsafe-inline&apos; *">

Environment: Cordova CLI: 5.4.0 Gulp version: CLI version 3.9.0 Gulp local: Local version 3.9.0 Ionic Version: 1.1.1 Ionic CLI Version: 1.7.8 Ionic App Lib Version: 0.6.4 OS: Windows 10 Node Version: v4.2.2

nicmyers avatar Nov 16 '15 22:11 nicmyers

+1

adriangordon1231 avatar Nov 17 '15 02:11 adriangordon1231

Can you let us know here? https://github.com/driftyco/ionic-io-issues/issues. Seems related to CLI or platform. cc @ericb

mlynch avatar Dec 06 '15 06:12 mlynch

+1 This must be a issue with how encoding is done on page index.html.

I use Visual Studio 2015 Update 1 and i have set encoding to UTF-8 without signature - Codepage 65001 that someone tip me about.

In Content Security Policy it switches some of the ' signs to &apos. <meta http-equiv="Content-Security-Policy" content="default-src * &apos;self&apos; &apos;unsafe-inline&apos; &apos;unsafe-eval&apos;;img-src &apos;self&apos; data: https://*; style-src http://* https://* &apos;unsafe-inline&apos;; script-src * &apos;self&apos; &apos;unsafe-inline&apos; &apos;unsafe-eval&apos;">

This is happening when i use Ionic Upload command and i think it is cachebuster you run with ionic upload that ruins index.html file..

If i remove Content Security meta it works...and it dont scramble index.html..

mrweiland avatar Dec 16 '15 08:12 mrweiland

+1

louisdoe avatar Jan 22 '16 20:01 louisdoe

+1

samazary avatar Feb 24 '16 20:02 samazary

+1

funador avatar Apr 21 '16 04:04 funador

This is more a problem with editor - like Visual Studio that maybe save files in bad encoding. When coding angular use Visual Code or Notepad. :) I guess Ionic team can try to parse index file when doing Ionic Upload... but not that big problem because solution is simple.

mrweiland avatar Apr 21 '16 22:04 mrweiland