Thursday, February 21, 2008

Removing double spaces in dreamweaver

I've been having a problem with Macromedia Dreamweaver CS3 adding double spaces (an extra line) to files I download to edit. I made sure my FTP program (FireFTP) and Dreamweaver are sending the files binary instead of Ascii, but that didn't help. I could not use Commands>>Apply Source Formatting - because it is a php file.

As it turns out that end of the line characters can be formatted differently for different systems; i.e. Unix (Line Feed), Windows (Control Break & Line Feed), Mac (Control Break). My Dreamweaver setup was formatting the files with a Windows line end character while the files were from Unix thus adding the extra line.

So to remove the double spaces I set: Dreamweaver>>Edit>>Preferences>>Code Format>>Line Break Type to "LF (Unix)" ... problem solved!

P.S. I also learned during that in Dreamweaver you can use Shift>Enter to create a single line (
) instead of Enter which creates a double line (

).

9 comments:

Anonymous said...

Tnx mate, I didn't know where to find this thing, great help!

Remus said...

Thx, i had many messed up pages and didnt find a solution since now! This solved it.

Anonymous said...

I have been looking for (apparently not hard enough) a solution to this major annoyance for over 4 years! Thank you.

Anonymous said...

Commands - Apply sourceformatting.
THANK YOU! This is going to save me so much frustration!

Anonymous said...

Thanks! The double spaces have been very frustrating! Problem solved!

Anonymous said...

thank you very much had been looking for this solution long

Apex said...

Thanks! Those double lines where bugging me for a long time.

Chris Gilchrist said...

Hi Ben,

We built a free to use Custom Command for Dreamweaver so with one click every multiple space is removed for you. You can download it here: http://www.hitreach.co.uk/blog/quickly-remove-white-spaces-in-dreamweaver-after-pasting-from-microsoft-word/

Anonymous said...

You are the coolest!!! thanks so much...new to web design and loved this information!!! great job!