Skip to main content
higgsyd
Inspiring
Sep 24, 2020 4:35 PM UTC
Question

Apply source formatting removes all my blank lines

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 is closed to new replies. Start a new post to keep the conversation going.

    10 replies

    Legend
    Sep 24, 2020 10:14 PM UTC

    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,
    }

     

    Translate
    Paul-M - Community Expert
    higgsyd
    higgsydAuthor
    Inspiring
    Sep 25, 2020 8:23 AM UTC

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

    Translate
    Legend
    Sep 24, 2020 7:06 PM UTC

    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.

    Translate
    Legend
    Sep 24, 2020 7:08 PM UTC

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

    Translate
    Nancy OShea
    Community Expert
    Community Expert
    Sep 24, 2020 7:41 PM UTC

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

     

    Translate
    Nancy O'Shea— Product User & Community Expert
    Nancy OShea
    Community Expert
    Community Expert
    Sep 24, 2020 6:37 PM UTC

    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:

     

    Translate
    Nancy O'Shea— Product User & Community Expert