Skip to main content
Known Participant
December 12, 2018
Answered

Insert the unicode character for a non-breaking space instead of the html entity "& nbsp"

  • December 12, 2018
  • 3 replies
  • 4148 views

I use the latest version of macOS Mojave and the localized german version of DW 2019.

Which config file do I have to edit, when I want to change the behaviour of CMD+SHIFT+SPACE in the code and design view?

Standard behaviour:  & n b s p ; (spaces only for this forum posting)
I wish to get the unicode character " "

Why do I like to change the behaviour?
The readability of source code is a lot better, with less entities.

What did I try?

I edited

/Applications/Adobe Dreamweaver CC 2019/Configuration/Objects/Characters/NBSP.htm

var nbspChar = "&nbsp";

to

var nbspChar = " ";

I has no effect to CMD+SHIFT+SPACE

Thanks for your help.

This topic has been closed for replies.
Correct answer Preran

I checked with the team, and it is in their backlog. I suggest using this link Adobe Dreamweaver CC: Feature Ideas​ to create a feature request. I am guessing that they require more traction on this request before they proceed.

Thanks,

Preran

3 replies

Known Participant
December 17, 2018

I found a nice workaround for the task, which is a solution at the same time for other replacements as well.

But Preran, I'm still interested in your feedback

It is a very old script for DW of the year 2004.

But it still works fine in DW 2019.

I'm not a programmer, so if anyone thinks "Oh what a bad code, I show you a better one." please feel free.

The script:

***

<!DOCTYPE HTML SYSTEM "-//Macromedia//DWExtension layout-engine 5.0//dialog">

<!-- MENU-LOCATION=NONE -->

<!--

Author: Danilo Celic

Usage:

Save this file "replace_beforeSave.htm" in that directory:

""~/Library/Application Support/Adobe/Dreamweaver CC 2019/de_DE/Configuration/Commands/replace_beforeSave.htm"

Attention!

Don't change the second part of the name behind the "_".

That part causes the script beeing executed before the file is saved.

Complete path to the file "dwscripts.js":

"/Applications/Adobe Dreamweaver CC 2019/configuration/Shared/Common/Scripts/dwscripts.js"

-->

<html>

<head>

<meta charset="utf-8" />

<title></title>

<script src="../Shared/Common/Scripts/dwscripts.js"></script>

<script>

function canAcceptCommand(){

    return true;

}

function getFileName(url) {

  var index = url.lastIndexOf('/');

  if (index != -1) retVal = url.substring(index + 1);

  else retVal = url;

  return retVal;

}

function runCmd(){

    var dom = dw.getDocumentDOM();

    dom.synchronizeDocument();

    var path = dw.getDocumentPath('document');

    if(getFileName(path) != 'replace_beforeSave.htm'){

        var docEl = dom.documentElement;

        var tempDoc = docEl.outerHTML;

       

// Replace

        tempDoc = tempDoc.replace(/ /g,' ');

        tempDoc = tempDoc.replace(/&quot;/g,'"');

   

        docEl.outerHTML = tempDoc;

    }   

}

</script>

</head>

<body onload="runCmd();">

</body>

</html>

Preran
Community Manager
PreranCommunity ManagerCorrect answer
Community Manager
December 18, 2018

I checked with the team, and it is in their backlog. I suggest using this link Adobe Dreamweaver CC: Feature Ideas​ to create a feature request. I am guessing that they require more traction on this request before they proceed.

Thanks,

Preran

Known Participant
December 18, 2018

Thanks a lot Preran, that's really nice from you.

And it makes me happy, when we users can contribute some ideas to make DW a little better.

Best Regards.

Known Participant
December 12, 2018

The software of the forum changed the original subject of the first posting, probably because it contains an entity.

Now the meaning of the subject cannot be understood.

@Moderator

Because I'm not allowed to change the subject, please be so kind to change it to:

DW 2019 on macOS: [Non breaking space] Insert the unicode character " " (U+00A0) instead of the entity "& n b s p ;" with CMD+SHIFT+SPACE

Legend
December 12, 2018

As Brackets is the code editor in Dreamweaver you could try this extension to 'visualise' non breaking spaces and tabs in code view:

GitHub - DennisKehrig/brackets-show-whitespace: Show Indentations in Brackets

I'm a windows user and would copy the Brackets extension folder to path:

C:\Users\paulm\AppData\Roaming\Adobe\Dreamweaver CC 2019\en_US\Configuration\Brackets\extensions\user\

So you need the equivalent on Mac.

You may need to edit the main,js file in the extension folder and change the shortcut key assigned to activate/deactivate it to one which is available

Paul-M - Community Expert
Known Participant
December 12, 2018

@Energize

Thanks for your help :-)

Your answer refers to my other question

Re: DW 2019 on macOS: How to make a unicode character of a non breaking space visible?

about visualization.

Ben blocked it and I asked him to reopen it.

Please, Ben, move the answer from Energize and my reply to that thread, too.

I found the equivalent folder on macOS:/Users/peter/Library/Application Support/Adobe/Dreamweaver CC 2019/de_DE/Configuration/Brackets/extensions/user

It worked fine.

Now I the "non breaking spaces" are visualized in the code view as a red dot.

But they are still not visualiszed in the design view.

Is that posible too?

Legend
December 12, 2018

Design view is an old component of Dreamweaver that Adobe stopped developing a few years back , I can't help you with that issue I'm afraid.

Paul-M - Community Expert