Remove Whitespace in Dreamweaver – White Space Removal Dreamweaver


Problem: Extra lines of whitespace appear in your PHP or HTML files in Dreamweaver after downloading your files from your server to your computer. Scroll to the end of this Dreamweaver whitespace fix to make sure this is the problem you are trying to fix – shows before and after Dreamweaver whitespace screenshots.

Solution:
In Dreamweaver either right mouse click anywhere in your code in Code View and click Find and Replace, use Ctrl + F to launch the Find and Replace window, or click on the Edit menu and choose Find and Replace. All of these methods will launch the Dreamweaver Find and Replace window shown below.

Remove Whitespace in Dreamweaver
Remove Whitespace in Dreamweaver

Find in: Current Document should be selected unless you want to remove whitespace from several files all at once.
Search: Source Code should be selected.
Find: [\r\n]{2,}
Replace: \n
Options: Use regular expressions should ONLY be selected (checked).
Click the Replace All button.

Make sure that if you copy and paste directly from this page that you do not have any whitespace after [\r\n]{2,} in the Find: window. The blinking mouse cursor should be right after [\r\n]{2,} and not below it on a new line. Nothing bad will happen if you do not do this, but the whitespace will also not be removed from your files.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s