Optimize code, Clean up code – Adobe Dreamweaver CC 2015 User Manual
Page 398

391
Coding
Last updated 6/3/2015
The lines that contain the errors or warnings are highlighted in red and yellow respectively. You can double click a
message in the Output panel to jump to the line where the error has occurred. In Code view, you can also hover your
mouse over the line numbers of the erroneous lines to see a preview of the error or warning.
The Output panel lists 50 messages at a time with the errors listed before warnings. As and when you fix the errors, the
list in the panel scrolls to display the next set of error.
Optimize code
Clean up code
You can automatically remove empty tags, combine nested font tags, and otherwise improve messy or unreadable
HTML or XHTML code.
For information on how to clean up HTML generated from a Microsoft Word document, se
1
Open a document:
• If the document is in HTML, select Commands > Clean Up HTML.
• If the document is in XHTML, select Commands > Clean Up XHTML.
For an XHTML document, the Clean Up XHTML command fixes XHTML syntax errors, sets the case of tag
attributes to lowercase, and adds or reports the missing required attributes for a tag in addition to performing
the HTML cleanup operations.
2
In the dialog box that appears, select any of the options, and click OK.
Note: Depending on the size of your document and the number of options selected, it may take several seconds to
complete the cleanup.
Remove Empty Container Tags
Removes any tags that have no content between them. For example, and
are empty tags, but the tag in some text is not.
Remove Redundant Nested Tags
Removes all redundant instances of a tag. For example, in the code This is
what I really wanted to say, the b tags surrounding the word really are redundant and would be
removed.
Remove Non-Dreamweaver HTML Comments
Removes all comments that were not inserted by Dreamweaver. For
example, would be removed, but wouldn’t,
because it’s a Dreamweaver comment that marks the beginning of an editable region in a template.
Remove Dreamweaver Special Markup
Removes comments that Dreamweaver adds to code to allow documents to
be automatically updated when templates and library items are updated. If you select this option when cleaning up
code in a template-based document, the document is detached from the template. For more information, see
Remove Specific Tag(s)
Removes the tags specified in the adjacent text box. Use this option to remove custom tags
inserted by other visual editors and other tags that you don’t want to appear on your site (for example, blink).
Separate multiple tags with commas (for example, font,blink).