This application takes in an HTML file with default Dreamweaver table of contents formatting and reformats the table of contents to follow WET guidelines. It also generates clearer links for the table of contents, and replaces the old links in the main document with these new links.

Before using the tool, make sure that:

  1. you have accepted all tracked changes and removed all comments in the Word document.
  2. the pasted HTML document has proper indentation (in Dreamweaver, Edit -> Code -> Apply Source Formatting).
  3. the pasted HTML document uses double quotes (e.g. "x") instead of single quotes (e.g. 'x') for tag attributes.


HTML file:



(Optional) Enter which line the table of contents starts on in the HTML file (beginning from line 1):

(Optional) Enter which line the table of contents ends on in the HTML file (beginning from line 1): 

Include any lines that should be part of the formatted table of contents, e.g. the header that states "Table of Contents". If the above values aren't filled in, the tool will search for the first two lines between <br clear="all"> in the document that contain the table of contents structure selected above.

Initial string for table of contents entry IDs:











Note that since this code adds/removes tags while making specific assumptions about formatting / tags used, the immediate output WILL contain formatting errors if the original Dreamweaver paste is malformed enough. Be sure to go through the document and manually fix any resulting errors - Dreamweaver is helpful for this.

This tool will search for each entry in the table of contents and replace all instances of it in the Word document with a header (that the table of contents entry links to). This is one of the most common sources of errors that the tool creates. You will have to fix these manually; to aid in this, the original line is included as a comment above the replaced line.

This tool assumes the input has proper HTML formatting (in Dreamweaver, Edit -> Code -> Apply Source Formatting). It may also be worth running through the general Dreamweaver formatting tool if the current document is malformed enough.

Check the console (ctrl + shift + i) for logs on number of entries found, entries that did not have any content matches to link to, and potential error messages.


Details on list numberings

If the option to search for list numberings is selected, the tool checks each line in the table of contents to see if it starts with a list number, e.g. 3.1. The list numbering must be formatted with numbers and periods.

For example, if there is a line that consists of "3.1 Overview", then "3.1" is extracted as the list numbering.

This list numbering is used for two things:

If a line does not have a list number, then it uses the indentation + 1 of the last line that does.

More in-depth information can be found in the readme.