Skip to main content
New Participant
November 8, 2016
Answered

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

  • November 8, 2016
  • 5 replies
  • 2314 views

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;

    });

}

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;

    });

}

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

This topic has been closed for replies.
Correct answer Preran

Thank you for reporting this bug. I reported it to the team and they have logged a bug for it with High Priority status. The fix should make its way into a future update.

If this makes Dreamweaver unusable for your current needs, continue using the previous version until we have an update wtih this fix.

I apologize for the inconvenience.

Thanks,

Preran

5 replies

Preran
Community Manager
PreranCommunity ManagerCorrect answer
Community Manager
November 9, 2016

Thank you for reporting this bug. I reported it to the team and they have logged a bug for it with High Priority status. The fix should make its way into a future update.

If this makes Dreamweaver unusable for your current needs, continue using the previous version until we have an update wtih this fix.

I apologize for the inconvenience.

Thanks,

Preran

Participating Frequently
November 9, 2016

Same issue here, even after turning off the rewriting rules.


Bug!

BenPleysier
Community Expert
November 8, 2016
Wappler is the DMXzone-made Dreamweaver replacement and includes the best of their powerful extensions, as well as much more!
Jon Fritz
Community Expert
November 8, 2016

I can confirm the same action is taking place under W7 in CC2017.

I was about to say "it's not happening here" but I closed and reopened the file and it was rewritten, html entities were changed to their characters.

EDIT: Make sure to file a bug report here: Feature Request/Bug Report Form

Nancy OShea
Community Expert
November 8, 2016

DOH!

That's awful .

Who is filing the Bug Report?

Adobe Dreamweaver CC: Feature Ideas

Nancy O.

Nancy O'Shea— Product User & Community Expert
Jon Fritz
Community Expert
November 8, 2016

I filed one. I say we flood the dev team with this one.

Be very, very careful with any currently functioning scripts you may have in your sites. Making a change and saving them could blow the whole thing apart.

EDIT: I tested the same script as a <head> item in an html page and it doesn't "update" it on closing and reopening.,

Preran​,

Could you help expedite the dev team's awareness of this one?

Nancy OShea
Community Expert
November 8, 2016

Try changing your Preferences > Code Rewriting

Nancy O'Shea— Product User & Community Expert
Jon Fritz
Community Expert
November 8, 2016

WOW, this is horrible!

It doesn't rewrite the code until you close the .js file and reopen it.

Changing the setting has no effect.

Owch!

That's not going to fly.