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?

Jon Fritz
Community Expert
Community Expert
December 12, 2018

Thanks for your answer Jon.

That are really bad news.


I just found, that in the live view you cannot work with complex data tables (which I use a lot).

Merging cells for example is impossible.

Does anyone know, why Adobe wants to give up the great design view?

What's your personal opinion about the live view compared to the design view?

Is there any aspect, where the live view is more usable than design view (and of course I talk about a design view, which the developers take care about, implementing a rendering of vh and vw etc. as an example of course)?


As for your other questions...

1. Since the introduction of the Live View Editor a few versions back, the plan seemed to be to eventually replace Design View all together. My guess is that idea ended up being a lot more difficult than they originally expected. There was a point where they removed a fair portion of table editing functions in a dot release (because Live View had them) and users collectively screamed from the rooftops until they reversed the decision.

2. I don't use Design View often, preferring to code manually, though there are times where it's just easier to click a box/image in Design and make changes in the Properties window than it is to find the code and make changes in Code View. Like the CSS Designer, I've never made regular use of any of the Live View Editor's features, they're all far slower than hand coding or Design View for me.


3. Aside from Live View rendering a much more accurate representation of a page, especially in CC2019, I have not come across any workflows where the end result could not be achieved faster/easier in Design or Code View. Live View just isn't an efficient editor in its current incarnation. Maybe at some point in the future, it could be, as of now, it's not.