Can Dreamweaver automatically re-format existing code? - Geeks to Go Forums

Jump to content

Log in Register Register Malware removal guide How it works

Can Dreamweaver automatically re-format existing code? Cleaning up an HTML block with auto-indenting to indicate nesting...

#1 stearmandriver

  • Group: Member
  • Posts: 67
  • Joined: 03-June 05

Posted 23 September 2008 - 12:17 PM

Hi,

I've inherited a mess of a website. It seems to have been built with an old WYSIWYG editor that wrote code kind of randomly, and it's hard to read through. Does anyone know if there's an option in DW CS3 that will automatically fix this, and create a series of indentations based on the nesting of different elements? It's a small thing, but would sure be convenient.

I know DW will auto-indent new code that I write, I'm just curious about pre-exising stuff like this.

Thanks,
Joe

#2 Major Payne

  • Group: Retired Staff
  • Posts: 5,307
  • Joined: 26-January 05

Posted 23 September 2008 - 01:06 PM

Dreamweaver is not much at correcting code to HTML 4.01/CSS 2.1 Standards. You might try HTML Tidy found in some of the free HTML Editors, but if the errors are really bad, you will have to do those by hand.

You might use the following validators to get an idea of coding errors:

HTML Validator
CSS Validator
Link Checker

Use the "More Options", "Verbose" output where available.

#3 stearmandriver

  • Group: Member
  • Posts: 67
  • Joined: 03-June 05

Posted 23 September 2008 - 02:37 PM

Thanks Major... it's not so much syntax I was wondering about correcting, but the actual structure of the code. This stuff actually mostly validates, with just a few errors I'm working my way through. The syntax is ok... the code is just scattered everywhere. I was hoping there was something to re-order it into readable chunks, with indenting showing the nesting of elements. If not, no big deal, I'll survive. :)

Thanks...
Joe

#4 Major Payne

  • Group: Retired Staff
  • Posts: 5,307
  • Joined: 26-January 05

Posted 23 September 2008 - 03:31 PM

I re-order mine using Copy/Fine/Replace function in my HTML Editor when a page's code is all over the place. Where I can't use that method, then I take it line by line using the Delete button until code is blocked out to where it is readable. All this has to be done manually although you could try HTML Tidy and let it correct/restructure the code for you. I don't really like the way HTML Tidy corrects code, but it is better than nothing.

#5 stearmandriver

  • Group: Member
  • Posts: 67
  • Joined: 03-June 05

Posted 23 September 2008 - 03:37 PM

Thanks, I'll check it out.

#6 Major Payne

  • Group: Retired Staff
  • Posts: 5,307
  • Joined: 26-January 05

Posted 23 September 2008 - 04:43 PM

You're welcome. Give a shout if you need more info concerning this problem.

#7 ykpuiacur

  • Group: Member
  • Posts: 1
  • Joined: 18-January 11

Posted 18 January 2011 - 08:32 AM

You can try VS2005/8/10.

They can re-format code.

Share this topic: