• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Apply source formatting removes all my blank lines

Participant ,
Sep 24, 2020 Sep 24, 2020

Copy link to clipboard

Copied

I like lots of  blank lines between chunks of my code but source formatting command removes them all!  I looked at the tag libraries but cannot see how that could help me as it's just about how lines break up before and after tags.  My blank lines are not tags so cannot be changed here.  Am I alone in wanting blank lines to space out my code for readability?

Views

299

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 24, 2020 Sep 24, 2020

Copy link to clipboard

Copied

Only one person on planet Earth cares about code formatting -- you, the coder.   If indents and line breaks Before, Inside and After tags are not sufficient, don't use Auto Formatting.

 

According to Google...

You should minify your HTML, CSS, and JavaScript resources before transfering to your production server:

 

Nancy O'Shea— Product User, Community Expert & Moderator

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Sep 24, 2020 Sep 24, 2020

Copy link to clipboard

Copied

No you are NOT alone. Sometimes set line height in the editor is enough but I dont know if DW has that option. At other times the code IS more readable and managable if you seperate it into chunks using some line breaks. Do I care about minifying any file before publisbing, absolutely not as my code is streamlined, unlike many developers code who use 101+ links to external usually massively bloated css and javascript files. Yes, they certainly do need to minify their bloated workflow files because they are very, very bad developers, good devlopers dont need to.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Sep 24, 2020 Sep 24, 2020

Copy link to clipboard

Copied

Forum crapped out once again....there's currently no 'edit' post options showing under '••• More' drop-down' in Firefox on Mac.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 24, 2020 Sep 24, 2020

Copy link to clipboard

Copied

Yes, there is a problem with editing posts. Only moderators can edit.  The concerned team knows about it but there is no ETA yet.

 

Nancy O'Shea— Product User, Community Expert & Moderator

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Sep 24, 2020 Sep 24, 2020

Copy link to clipboard

Copied

Thanks for confirming the problem exists Nancy.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 24, 2020 Sep 24, 2020

Copy link to clipboard

Copied

It' broken as far as I can see, it should be possible.

 

You should be able to put a .jsbeautify file in your project root folder with something like below ... I'd say report a bug here

 

{
  "preserve_newlines": true,
  "max_preserve_newlines": 5,
}

 

Paul-M - Community Expert

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Sep 25, 2020 Sep 25, 2020

Copy link to clipboard

Copied

thanks for all your comments.  I have raised a new idea as suggested.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 25, 2020 Sep 25, 2020

Copy link to clipboard

Copied

I'm not sure that .jsbeautifyrc file works for HTML, I was thinking that it was only working for JS, CSS and PHP, but HTML was itselft refering to Tag Library.

For what I thing it's not a bug report but a feature request, but perhaps I'm wrong

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 25, 2020 Sep 25, 2020

Copy link to clipboard

Copied

.jsbeautifyrc options are supposed to work for HTML and for PHP, there's an adiditonal PHP plugin for jsbeautify which I assume the Adobe devs created. In the Dreamweaver configuration folder there are config files for HTML, PHP, CSS and JS for jsbeautify and they have the max_preserve_newlines option but it just doesn't work as expected. Definitely a bug, maybe tag library does override it but it seems all a bit mixed up and confused...

 

 

Paul-M - Community Expert

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Sep 25, 2020 Sep 25, 2020

Copy link to clipboard

Copied

LATEST

yep, you probably right, but I just dug the doc, and it is not really clear on that point, and should be clarified.

https://helpx.adobe.com/dreamweaver/user-guide.html/dreamweaver/using/format-code.ug.html

it is said that HTML tags in a PHP document are formatted as per preferences in tag libraries.

and the JSON sample just describes the use of CSS, JS and PHP properties

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines