12 Replies Latest reply on Nov 9, 2016 6:51 AM by WeaponX86

    CC 2017 - HTML entities in js files being converted when saved

    WeaponX86

      Here is my function:

       

      function escapeHtml(sStr) {
          
          // Dreamweaver CC 2017 is converting these entities. I can't stop it.
          var entityMap = {
              "&": `&`,
              "<": "&lt;",
              ">": "&gt;",
              '"': "&quot;",
              "'": "&#39;",
              "/": "&#x2F;"
          };
          
          return String(sStr).replace(/[&<>"'\/]/g, function (s) {
              return entityMap[s];
          });
      }
      

       

      After saving:

      function escapeHtml(sStr) {
          
          // Dreamweaver CC 2017 is converting these entities. I can't stop it.
          var entityMap = {
              "&": `&`,
              "<": "<",
              ">": ">",
              '"': """,
              "'": "'",
              "/": "/"
          };
          
          return String(sStr).replace(/[&<>"'\/]/g, function (s) {
              return entityMap[s];
          });
      }
      

       

      This is just a regular .js file. Why is this happening?