Clean up double line spacing in Dreamweaver code

Adobe_Dreamweaver_CS6_Icon

I work across Mac and Windows, with Dreamweaver running on my Mac, and code that sometimes will be hosted on Windows Servers and sometimes not. So I often run into the problem of erratic line spacing. If I have code saved on my Mac HDD (as opposed to my Windows VM), push it up to a Windows Server, then pull it down again, I sometimes wind up with the code double spaced when I open the file again in Dreamweaver.

I finally tracked down a quick solution to clean up these pages, with grateful thanks to this page: Permanently Remove Double Space in Dreamweaver Code View.

Do a search and replace:

  • Search for: [\r\n]{2,}
  • Replace with: \n

Make sure you have the Use Regular Expressions option checked.

Of course, it’s also good to make sure you have the Line Beak Type set correctly under Dreamweaver’s Preferences, but I’ve found that doesn’t really help when you are working cross-platform.

Leave a comment