Skip to main content
higgsyd
Inspiring
September 24, 2020
Question

Apply source formatting removes all my blank lines

  • September 24, 2020
  • 3 replies
  • 477 views

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?

    This topic has been closed for replies.

    3 replies

    Legend
    September 24, 2020

    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
    higgsyd
    higgsydAuthor
    Inspiring
    September 25, 2020

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

    Legend
    September 24, 2020

    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.

    Legend
    September 24, 2020

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

    Nancy OShea
    Community Expert
    Community Expert
    September 24, 2020

    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
    Nancy OShea
    Community Expert
    Community Expert
    September 24, 2020

    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