Dreamweaver Extra Linebreaks & Spaces

html code

We found Dreamweaver was inserting extra lines in HTML code when editing downloaded pages.

Why it’s doing it, how to stop it and how to remove the extra lines…This happens when downloading a file from a Unix or Linux server to a local PC that’s running a Windows based OS and then opening it in Dreamweaver.

To stop it happening, in Dreamweaver  click Edit on the menu and then Preferences. Click Code Format and on the “Line Break Type” select “LF (unix)”. Click Ok and that will stop these extra lines being added.

To remove the extra linebreaks and white space simply open the Find & Replace box (make sure the search on the source code view) and the “Use regular expression” is the ONLY box ticked.

Copy and Paste this bit to make sure you have it right…
Find: [rn]{2,}
Replace: n
Click  “replace all” and all the extra linebreaks and spaces will be removed.

Leave a Comment